Skip to main content

Google Stackdriver

Monitoring Connector Assets​

Monitored Objects​

The Monitoring Connector Google Stackdriver collects metrics:

  • Get-metrics

A description of all GCP metrics can be found here:

Collected Metrics​

For all collected metrics, following aggregation are available: average, minimum, maximum and total.

Metric nameDescriptionUnit
aggregation#metric_display_nameAny metric

E.g: average metric https/backend_latencies = average#https.backend_latencies


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 ScopeDescription and manage your data across Google Cloud Platform services

How to create a service account key:


Deploy the key file on every Poller expected to monitor Google Cloud resources. The key file should be readable by centreon-engine poller.


  1. Install the Centreon Plugin on every Poller:
yum install centreon-plugin-Cloud-Gcp-Management-Stackdriver-Api
  1. On the Centreon Web interface in Configuration > Monitoring Connector Manager, install the Google Stackdriver 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:

XGCPKEYFILEPATHService account key json file
PROXYURLConfigure proxy URL
GCPEXTRAOPTIONSAny extra option you may want to add to every command_line (eg. a --verbose flag)
DUMMYSTATUSHost state. Default is OK, do not modify it until you know what you are doing
DUMMYOUTPUTHost check output. Default is 'This is a dummy check'. Customize it with your own if needed

WARNING: Service account key file must be stored on Centreon Poller. centreon-engine user account must have read privileges on that file.

  • Add a new service linked the Host and apply Cloud-Gcp-Management-Stackdriver-Get-Metrics-Api-custom Service Template

Once the template applied, some Macros have to be configured:

XGCPDIMENSIONNAMEThe name of the dimension to filter on.
XGCPDIMENSIONOPERATORDefine the type of filter match to use. Can be: equals, regexp, starts.
XGCPDIMENSIONVALUEValue to the dimension monitor.
XAPIGoogle Cloud API. Eg.:
XMETRICMetric to monitor. Eg.: instance/cpu/utilization


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/ \
--plugin=cloud::google::gcp::management::stackdriver::plugin \
--mode=get-metrics \
--key-file=/var/lib/centreon-engine/centreon-dev-6e5531fc9e82.json \
--dimension-name='metric.labels.instance_name' \
--dimension-operator='equals' \
--dimension-value='instance-centreon1-drb5' \
--metric='instance/cpu/utilization' \
--api='' \
--aggregation='average' \
--warning-metric='90' \
--critical-metric='95' \

Expected command output is shown below:

OK: Metric 'instance/cpu/utilization' of resource 'instance-centreon1-drb5' value is 0.0111772524293797 | 'average#instance.cpu.utilization'=0.0111772524293797;0:90;0:95;;
Metric 'instance/cpu/utilization' of resource 'instance-centreon1-drb5' value is 0.0111772524293797

The command above monitors cpu utilization of a Google Compute Engine instance (--mode=instance/cpu/utilization identified by the name instance-centreon1-drb5 (--dimension-name='metric.labels.instance_name' --dimension-operator='equals' --dimension-value='instance-centreon1-drb5').

This command would trigger a WARNING alarm if cpu utilization is more than 90% (--warning-metric='90') and a CRITICAL alarm for more than 95% (--critical-metric='95').

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/ \
--plugin=cloud::google::gcp::management::stackdriver::plugin \
--mode=get-metrics \

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.