Google Storage
Monitoring Connector Assetsβ
Monitored Objectsβ
The Monitoring Connector Google Storage collects metrics for:
- Bucket
Discovery rulesβ
The Centreon Monitoring Connector Google Storage includes a Host Discovery provider to automatically discover storages for a given Google Cloud Project.
This provider is named Google Storage:
Note that the key file must be deployed on the Poller(s) expected to discover GCP assets.
More information about the Host Discovery module is available in the Centreon documentation: Host Discovery
Collected Metricsβ
For all collected metrics, we can choose the aggregation: average, minimum, maximum and total.
- Bucket
Metric name | Description | Unit |
---|---|---|
bucket_name~aggregation#storage.bucket.objects.count | Number of objects | |
bucket_name~aggregation#storage.network.received.volume.bytes | Count of bytes received over the network | B |
bucket_name~aggregation#storage.network.received.volume.bytespersecond | Count of bytes received per second over the network | B/s |
bucket_name~aggregation#storage.network.sent.volume.bytes | Count of bytes sent over the network | B |
bucket_name~aggregation#storage.network.sent.volume.bytespersecond | Count of bytes sent per second over the network | B/s |
Prerequisitesβ
Google Cloud Configurationβ
Configure a service account key (download its private key as a JSON file) for which the following privileges have to be granted:
Google Scope | Description |
---|---|
https://www.googleapis.com/auth/cloud-platform | View and manage your data across Google Cloud Platform services |
How to create a service account key: https://developers.google.com/identity/protocols/oauth2/service-account
Centreonβ
Deploy the key file on every Poller expected to monitor Google Cloud resources. The key file should be readable by centreon-engine poller.
Setupβ
- Online License
- Offline License
- Install the Centreon Plugin on every Poller:
yum install centreon-plugin-Cloud-Gcp-Storage-Api
- On the Centreon Web interface in Configuration > Monitoring Connectors Manager, install the Google Storage Monitoring Connector
- Install the Centreon Plugin on every Poller:
yum install centreon-plugin-Cloud-Gcp-Storage-Api
- On the Centreon Central server, install the Centreon Monitoring Connector from the RPM:
yum install centreon-pack-cloud-gcp-storage
- On the Centreon Web interface in Configuration > Monitoring Connectors Manager, install the Google Storage Monitoring Connector
Host configurationβ
- Add a new Host and apply the Cloud-Gcp-Storage-custom Host Template
Once the template applied, some Macros have to be configured:
Mandatory | Name | Description |
---|---|---|
X | GCPKEYFILEPATH | Service account key json file |
X | GCPSCOPEENDPOINT | Google Scope. Default: https://www.googleapis.com/auth/cloud-platform |
X | GCPDIMENSIONNAME | The name of the dimension to filter on. Default: resource.labels.bucket_name |
X | GCPDIMENSIONOPERATOR | Define the type of filter match to use. Default: equals |
X | GCPDIMENSIONVALUE | Name of the bucket you want to monitor. |
PROXYURL | Configure proxy URL | |
GCPEXTRAOPTIONS | Any extra option you may want to add to every command_line (eg. a --verbose flag) | |
DUMMYSTATUS | Host state. Default is OK, do not modify it until you know what you are doing | |
DUMMYOUTPUT | Host check output. Default is 'This is a dummy check'. Customize it with your own if needed |
Service account key file must be stored on Centreon Poller. centreon-engine user account must have read privileges on that file.
FAQβ
How to test the Plugin and what are the main options for?β
Once the plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:
/usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \
--plugin=cloud::google::gcp::storage::plugin \
--mode=bucket \
--key-file=/var/lib/centreon-engine/centreon-dev-6e5531fc9e82.json \
--dimension-name='resource.labels.bucket_name' \
--dimension-operator='equals' \
--dimension-value='centreon-dev.appspot.com' \
--aggregation='average' \
--warning-bucket-objects='1000' \
--critical-bucket-objects='2000' \
--verbose
Expected command output is shown below:
OK: Instance 'centreon-dev.appspot.com' aggregation 'average' metrics objects: 0.00, received: 0.00 B, sent: 382.00 B | 'centreon-dev.appspot.com~average#storage.bucket.objects.count'=0.00;0:1000;0:2000;0; 'centreon-dev.appspot.com~average#storage.network.received.volume.bytes'=0.00B;;;0; 'centreon-dev.appspot.com~average#storage.network.sent.volume.bytes'=382.00B;;;0;
Checking 'centreon-dev.appspot.com'
aggregation 'average' metrics objects: 0.00, received: 0.00 B, sent: 382.00 B
The command above monitors bucket usage of a Google Storage (--plugin=cloud::google::gcp::storage::plugin --mode=bucket
) identified
by the name centreon-dev.appspot.com (--dimension-name='resource.labels.bucket_name' --dimension-operator='equals' --dimension-value='centreon-dev.appspot.com'
).
This command would trigger a WARNING alarm if number of objects is more than 1000
(--warning-bucket-objects='1000'
) and a CRITICAL alarm for more than 2000 (--critical-bucket-objects='2000'
).
All the options as well as all the available thresholds can be displayed by adding the --help
parameter to the command:
/usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \
--plugin=cloud::google::gcp::storage::plugin \
--mode=bucket \
--help
Why do I get the following result UNKNOWN: No metrics. Check your options or use --zeroed option to set 0 on undefined values
?β
This command result means that Google Cloud does not have any value for the requested period.
This result can be overriden by adding the --zeroed
option in the command. This will force a value of 0 when no metric
has been collected and will prevent the UNKNOWN error message.