From e107cdd4ff6e0dea2e94847543d9febd9c8068fe Mon Sep 17 00:00:00 2001 From: YanMeddour Date: Tue, 4 Mar 2025 15:48:34 +0100 Subject: [PATCH] [CTOR-1433]-Refresh cloud-gcp-storage doc page --- .../procedures/cloud-gcp-storage.md | 349 ++++++++++++++---- .../procedures/cloud-gcp-storage.md | 348 +++++++++++++---- 2 files changed, 544 insertions(+), 153 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-gcp-storage.md b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-gcp-storage.md index ede00ff28544..6fd8ff4ca919 100644 --- a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-gcp-storage.md +++ b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-gcp-storage.md @@ -5,40 +5,57 @@ title: Google Storage import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Dépendances du connecteur de supervision -## Contenu du connecteur de supervision +Les connecteurs de supervision suivants sont automatiquement installés lors de l'installation du connecteur **Google Storage** +depuis la page **Configuration > Gestionnaire de connecteurs de supervision** : +* [Base Pack](./base-generic.md) -### Objets supervisés +## Contenu du pack -Le connecteur de supervision Google Storage collecte les données pour: -* Bucket +### Modèles -### Règles de découverte +Le connecteur de supervision **Google Storage** apporte un modèle d'hôte : + +* **Cloud-Gcp-Storage-custom** + +Le connecteur apporte le modèle de service suivant +(classé selon le modèle d'hôte auquel il est rattaché) : + + + -Le connecteur de supervision Centreon *Google Storage* inclut un *provider* de découverte d'Hôtes. -Celui-ci permet de découvrir l'ensemble des supports de stockage associés à un projet GCP donné: +| Alias | Modèle de service | Description | +|:-------|:------------------------------------|:------------------------------------| +| Bucket | Cloud-Gcp-Storage-Bucket-Api-custom | Contrôle les métriques de la bucket | -![image](../../../assets/integrations/plugin-packs/procedures/cloud-gcp-storage-provider.png) +> Les services listés ci-dessus sont créés automatiquement lorsque le modèle d'hôte **Cloud-Gcp-Storage-custom** est utilisé. + + + + +### Règles de découverte -> Le fichier *key* doit être déployé sur les Collecteurs utilisés pour la découverte en amont de son execution (voir chapitre Prérequis) +#### Découverte d'hôtes -Vous trouverez plus d'informations sur la découverte d'Hôtes et son fonctionnement sur la documentation du module: -[Découverte des hôtes](/docs/monitoring/discovery/hosts-discovery) +| Nom de la règle | Description | +|:----------------|:------------------------| +| Google Storage | Discover Google Storage | -### Métriques collectées +Rendez-vous sur la [documentation dédiée](/docs/monitoring/discovery/hosts-discovery) pour en savoir plus sur la découverte automatique d'hôtes. -Pour l'ensemble des métriques collectées, il est possible de choisir *aggregation*: _average_, _minimum_, _maximum_ et _total_. +### Métriques & statuts collectés + +Voici le tableau des services pour ce connecteur, détaillant les métriques et statuts rattachés à chaque service. -| 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 | +| Nom | Unité | +|:--------------------------------------|:------| +| storage.bucket.objects.count | count | +| storage.network.received.volume.bytes | B | +| storage.network.sent.volume.bytes | B | @@ -55,108 +72,290 @@ Créer une *clé de compte de service* (télécharger sa clé privée sous la fo Comment créer une clé de compte de service: https://developers.google.com/identity/protocols/oauth2/service-account -## Installation +## Installer le connecteur de supervision + +### Pack + +1. Si la plateforme est configurée avec une licence *online*, l'installation d'un paquet +n'est pas requise pour voir apparaître le connecteur dans le menu **Configuration > Gestionnaire de connecteurs de supervision**. +Au contraire, si la plateforme utilise une licence *offline*, installez le paquet +sur le **serveur central** via la commande correspondant au gestionnaire de paquets +associé à sa distribution : - + -1. Installer le Plugin sur tous les Collecteurs Centreon : +```bash +dnf install centreon-pack-cloud-gcp-storage +``` + + + ```bash -yum install centreon-plugin-Cloud-Gcp-Storage-Api +dnf install centreon-pack-cloud-gcp-storage ``` -2. Sur l'interface Web de Centreon, installer le connecteur de supervision *Google Storage* depuis la page **Configuration > Gestionnaire de connecteurs de supervision** + + + +```bash +apt install centreon-pack-cloud-gcp-storage +``` + + + + +```bash +yum install centreon-pack-cloud-gcp-storage +``` - + + +2. Quel que soit le type de la licence (*online* ou *offline*), installez le connecteur **Google Storage** +depuis l'interface web et le menu **Configuration > Gestionnaire de connecteurs de supervision**. + +### Plugin + +À partir de Centreon 22.04, il est possible de demander le déploiement automatique +du plugin lors de l'utilisation d'un connecteur. Si cette fonctionnalité est activée, et +que vous ne souhaitez pas découvrir des éléments pour la première fois, alors cette +étape n'est pas requise. + +> Plus d'informations dans la section [Installer le plugin](/docs/monitoring/pluginpacks/#installer-le-plugin). -1. Installer le Plugin sur tous les Collecteurs Centreon : +Utilisez les commandes ci-dessous en fonction du gestionnaire de paquets de votre système d'exploitation : + + + ```bash -yum install centreon-plugin-Cloud-Gcp-Storage-Api +dnf install centreon-plugin-Cloud-Gcp-Storage-Api +``` + + + + +```bash +dnf install centreon-plugin-Cloud-Gcp-Storage-Api ``` -2. Sur le serveur Central Centreon, installer le connecteur de supervision via le RPM: + + ```bash -yum install centreon-pack-cloud-gcp-storage +apt install centreon-plugin-cloud-gcp-storage-api ``` -3. Sur l'interface Web de Centreon, installer le connecteur de supervision *Google Storage* depuis la page **Configuration > Gestionnaire de connecteurs de supervision** + + + +```bash +yum install centreon-plugin-Cloud-Gcp-Storage-Api +``` -## Configuration +## Utiliser le connecteur de supervision + +### Utiliser un modèle d'hôte issu du connecteur + +1. Ajoutez un hôte à Centreon depuis la page **Configuration > Hôtes**. +2. Complétez les champs **Nom**, **Alias** & **IP Address/DNS** correspondant à votre ressource. +3. Appliquez le modèle d'hôte **Cloud-Gcp-Storage-custom**. Une liste de macros apparaît. Les macros vous permettent de définir comment le connecteur se connectera à la ressource, ainsi que de personnaliser le comportement du connecteur. +4. Renseignez les macros désirées. Attention, certaines macros sont obligatoires. -Ce connecteur de supervision est conçu de manière à avoir dans Centreon un hôte par bucket Google Storage. -Lorsque vous ajoutez un hôte à Centreon, appliquez-lui le modèle *Cloud-Gcp-Storage-custom*. -Une fois celui-ci configuré, certaines macros doivent être renseignées: +| Macro | Description | Valeur par défaut | Obligatoire | +|:---------------------|:-----------------------------------------------------------------------------------------------------|:-----------------------------------------------|:-----------:| +| GCPDIMENSIONNAME | Set dimension name (default: 'resource.labels.bucket\_name'). Can be: 'resources.labels.location' | resource.labels.bucket\_name | | +| GCPDIMENSIONOPERATOR | Set dimension operator (default: 'equals'. Can also be: 'regexp', 'starts') | equals | | +| GCPDIMENSIONVALUE | Set dimension value (required) | | | +| GCPKEYFILEPATH | Set GCP key file path | | X | +| GCPSCOPEENDPOINT | Set GCP scope endpoint URL (default: 'https://www.googleapis.com/auth/cloud-platform') | https://www.googleapis.com/auth/cloud-platform | | +| PROXYURL | Proxy URL. Example: http://my.proxy:3128 | | | +| GCPEXTRAOPTIONS | Any extra option you may want to add to every command (a --verbose flag for example). Toutes les options sont listées [ici](#options-disponibles). | | | -| 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 | +5. [Déployez la configuration](/docs/monitoring/monitoring-servers/deploying-a-configuration). L'hôte apparaît dans la liste des hôtes supervisés, et dans la page **Statut des ressources**. La commande envoyée par le connecteur est indiquée dans le panneau de détails de l'hôte : celle-ci montre les valeurs des macros. -> **WARNING**: La clé de service (format json) doit être hébergée sur le collecteur Centreon. L'utilisateur *centreon-engine* doit avoir les droits en lecture sur ce fichier. +### Utiliser un modèle de service issu du connecteur -## FAQ +1. Si vous avez utilisé un modèle d'hôte et coché la case **Créer aussi les services liés aux modèles**, les services associés au modèle ont été créés automatiquement, avec les modèles de services correspondants. Sinon, [créez les services désirés manuellement](/docs/monitoring/basic-objects/services) et appliquez-leur un modèle de service. +2. Renseignez les macros désirées (par exemple, ajustez les seuils d'alerte). Les macros indiquées ci-dessous comme requises (**Obligatoire**) doivent être renseignées. -### Comment puis-je tester le Plugin et que signifient les options des commandes ? + + + +| Macro | Description | Valeur par défaut | Obligatoire | +|:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| TIMEFRAME | Set timeframe in seconds (i.e. 3600 to check last hour) | 900 | | +| AGGREGATION | Define how the data must be aggregated. Available aggregations: 'minimum', 'maximum', 'average', 'total' and 'count'. Can be called multiple times | average | | +| FILTERMETRIC | Filter metrics (can be: 'storage/object\_count', 'network/received\_bytes\_count', 'network/sent\_bytes\_count') (can be a regexp) | | | +| WARNINGBUCKETOBJECTS | Threshold | | | +| CRITICALBUCKETOBJECTS | Threshold | | | +| WARNINGRECEIVEDVOLUME | Threshold | | | +| CRITICALRECEIVEDVOLUME | Threshold | | | +| WARNINGSENTVOLUME | Threshold | | | +| CRITICALSENTVOLUME | Threshold | | | +| EXTRAOPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). Toutes les options sont listées [ici](#options-disponibles). | --verbose | | + + + -Une fois le Plugin installé, vous pouvez tester celui-ci directement en ligne de commande -depuis un collecteur Centreon en vous connectant avec l'utilisateur *centreon-engine*: +3. [Déployez la configuration](/docs/monitoring/monitoring-servers/deploying-a-configuration). Le service apparaît dans la liste des services supervisés, et dans la page **Statut des ressources**. La commande envoyée par le connecteur est indiquée dans le panneau de détails du service : celle-ci montre les valeurs des macros. + +## Comment puis-je tester le plugin et que signifient les options des commandes ? + +Une fois le plugin installé, vous pouvez tester celui-ci directement en ligne +de commande depuis votre collecteur Centreon en vous connectant avec +l'utilisateur **centreon-engine** (`su - centreon-engine`). Vous pouvez tester +que le connecteur arrive bien à superviser une instance GCP en utilisant une commande +telle que celle-ci (remplacez les valeurs d'exemple par les vôtres) : ```bash /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 + --plugin=cloud::google::gcp::storage::plugin \ + --mode=bucket \ + --proxyurl='' \ + --key-file='/var/lib/centreon-engine/centreon-dev-6e5531fc9e82.json' \ + --scope-endpoint='https://www.googleapis.com/auth/cloud-platform' \ + --dimension-name='resource.labels.bucket\_name' \ + --dimension-operator='equals' \ + --dimension-value='' \ + --filter-metric='' \ + --timeframe='900' \ + --aggregation='average' \ + --warning-bucket-objects='' \ + --critical-bucket-objects='' \ + --warning-received-volume='' \ + --critical-received-volume='' \ + --warning-sent-volume='' \ + --critical-sent-volume='' \ + --verbose ``` -La commande devrait retourner un message de sortie de la forme ci-dessous: +La commande devrait retourner un message de sortie similaire à : ```bash 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 + ``` -Cette commande contrôle l'utilisation (```--mode=bucket```) d'une bucket Google Storage -ayant pour nom *centreon-dev.appspot.com* (```--dimension-name='resource.labels.bucket_name' --dimension-operator='equals' --dimension-value='centreon-dev.appspot.com'```). +### Diagnostic des erreurs communes + +Rendez-vous sur la [documentation dédiée](../getting-started/how-to-guides/troubleshooting-plugins.md) +pour le diagnostic des erreurs communes des plugins Centreon. + +### Modes disponibles -Cette commande déclenchera une alarme WARNING si le nombre d'objets est supérieur à 1000 (```--warning-bucket-objects='1000'```) -et une alarme CRITICAL si supérieur à 2000 (```--critical-bucket-objects='2000'```). +Dans la plupart des cas, un mode correspond à un modèle de service. Le mode est renseigné dans la commande d'exécution +du connecteur. Dans l'interface de Centreon, il n'est pas nécessaire de les spécifier explicitement, leur utilisation est +implicite dès lors que vous utilisez un modèle de service. En revanche, vous devrez spécifier le mode correspondant à ce +modèle si vous voulez tester la commande d'exécution du connecteur dans votre terminal. -Pour chaque mode, la liste de toutes les métriques, seuils associés et options complémentaires peut être affichée -en ajoutant le paramètre ```--help``` à la commande: +Tous les modes disponibles peuvent être affichés en ajoutant le paramètre +`--list-mode` à la commande : ```bash /usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \ - --plugin=cloud::google::gcp::storage::plugin \ - --mode=bucket \ - --help + --plugin=cloud::google::gcp::storage::plugin \ + --list-mode ``` -### J'obtiens le message d'erreur suivant: ```UNKNOWN: No metrics. Check your options or use --zeroed option to set 0 on undefined values``` +Le plugin apporte les modes suivants : + +| Mode | Modèle de service associé | +|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------| +| bucket [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/google/gcp/storage/mode/bucket.pm)] | Cloud-Gcp-Storage-Bucket-Api-custom | +| discovery [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/google/gcp/storage/mode/discovery.pm)] | Used for host discovery | + +### Options disponibles + +#### Options des modes + +Les options disponibles pour chaque modèle de services sont listées ci-dessous : -Lors du déploiement de mes contrôles, j'obtiens le message suivant 'UNKNOWN: No metrics. Check your options or use --zeroed option to set 0 on undefined values'. + + + +| Option | Description | +|:-------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --dimension-name | Set dimension name (default: 'resource.labels.bucket\_name'). Can be: 'resources.labels.location'. | +| --dimension-operator | Set dimension operator (default: 'equals'. Can also be: 'regexp', 'starts'). | +| --dimension-value | Set dimension value (required). | +| --filter-metric | Filter metrics (can be: 'storage/object\_count', 'network/received\_bytes\_count', 'network/sent\_bytes\_count') (can be a regexp). | +| --timeframe | Set timeframe in seconds (i.e. 3600 to check last hour). | +| --aggregation | Define how the data must be aggregated. Available aggregations: 'minimum', 'maximum', 'average', 'total' and 'count'. Can be called multiple times. | +| --warning-* --critical-* | Thresholds (can be: 'bucket-objects', 'received-volume', 'sent-volume'). | +| --per-second | Change the data to be unit/sec. | +| --mode | Define the mode in which you want the plugin to be executed (see --list-mode). | +| --dyn-mode | Specify a mode with the module's path (advanced). | +| --list-mode | List all available modes. | +| --mode-version | Check minimal version of mode. If not, unknown error. | +| --version | Return the version of the plugin. | +| --custommode | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option. | +| --list-custommode | List all available custom modes. | +| --multiple | Multiple custom mode objects. This may be required by some specific modes (advanced). | +| --pass-manager | Define the password manager you want to use. Supported managers are: environment, file, keepass, hashicorpvault and teampass. | +| --verbose | Display extended status information (long output). | +| --debug | Display debug messages. | +| --filter-perfdata | Filter perfdata that match the regexp. Example: adding --filter-perfdata='avg' will remove all metrics that do not contain 'avg' from performance data. | +| --filter-perfdata-adv | Filter perfdata based on a "if" condition using the following variables: label, value, unit, warning, critical, min, max. Variables must be written either %\{variable\} or %(variable). Example: adding --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")' will remove all metrics whose value equals 0 and that don't have a maximum value. | +| --explode-perfdata-max | Create a new metric for each metric that comes with a maximum limit. The new metric will be named identically with a '\_max' suffix). Example: it will split 'used\_prct'=26.93%;0:80;0:90;0;100 into 'used\_prct'=26.93%;0:80;0:90;0;100 'used\_prct\_max'=100%;;;; | +| --change-perfdata --extend-perfdata | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[newuom\],\[min\],\[max\]\] Common examples: =over 4 Convert storage free perfdata into used: --change-perfdata='free,used,invert()' Convert storage free perfdata into used: --change-perfdata='used,free,invert()' Scale traffic values automatically: --change-perfdata='traffic,,scale(auto)' Scale traffic values in Mbps: --change-perfdata='traffic\_in,,scale(Mbps),mbps' Change traffic values in percent: --change-perfdata='traffic\_in,,percent()' =back | +| --extend-perfdata-group | Add new aggregated metrics (min, max, average or sum) for groups of metrics defined by a regex match on the metrics' names. Syntax: --extend-perfdata-group=regex,namesofnewmetrics,calculation\[,\[newuom\],\[min\],\[max\]\] regex: regular expression namesofnewmetrics: how the new metrics' names are composed (can use $1, $2... for groups defined by () in regex). calculation: how the values of the new metrics should be calculated newuom (optional): unit of measure for the new metrics min (optional): lowest value the metrics can reach max (optional): highest value the metrics can reach Common examples: =over 4 Sum wrong packets from all interfaces (with interface need --units-errors=absolute): --extend-perfdata-group=',packets\_wrong,sum(packets\_(discard\|error)\_(in\|out))' Sum traffic by interface: --extend-perfdata-group='traffic\_in\_(.*),traffic\_$1,sum(traffic\_(in\|out)\_$1)' =back | +| --change-short-output --change-long-output | Modify the short/long output that is returned by the plugin. Syntax: --change-short-output=pattern~replacement~modifier Most commonly used modifiers are i (case insensitive) and g (replace all occurrences). Example: adding --change-short-output='OK~Up~gi' will replace all occurrences of 'OK', 'ok', 'Ok' or 'oK' with 'Up' | +| --change-exit | Replace an exit code with one of your choice. Example: adding --change-exit=unknown=critical will result in a CRITICAL state instead of an UNKNOWN state. | +| --range-perfdata | Rewrite the ranges displayed in the perfdata. Accepted values: 0: nothing is changed. 1: if the lower value of the range is equal to 0, it is removed. 2: remove the thresholds from the perfdata. | +| --filter-uom | Mask the units when they don't match the given regular expression. | +| --opt-exit | Replace the exit code in case of an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc). Default: unknown. | +| --output-ignore-perfdata | Remove all the metrics from the service. The service will still have a status and an output. | +| --output-ignore-label | Remove the status label ("OK:", "WARNING:", "UNKNOWN:", CRITICAL:") from the beginning of the output. Example: 'OK: Ram Total:...' will become 'Ram Total:...' | +| --output-xml | Return the output in XML format (to send to an XML API). | +| --output-json | Return the output in JSON format (to send to a JSON API). | +| --output-openmetrics | Return the output in OpenMetrics format (to send to a tool expecting this format). | +| --output-file | Write output in file (can be combined with json, xml and openmetrics options). E.g.: --output-file=/tmp/output.txt will write the output in /tmp/output.txt. | +| --disco-format | Applies only to modes beginning with 'list-'. Returns the list of available macros to configure a service discovery rule (formatted in XML). | +| --disco-show | Applies only to modes beginning with 'list-'. Returns the list of discovered objects (formatted in XML) for service discovery. | +| --float-precision | Define the float precision for thresholds (default: 8). | +| --source-encoding | Define the character encoding of the response sent by the monitored resource Default: 'UTF-8'. =head1 DESCRIPTION B\. =cut | +| --http-peer-addr | Set the address you want to connect to. Useful if hostname is only a vhost, to avoid IP resolution. | +| --proxyurl | Proxy URL. Example: http://my.proxy:3128 | +| --proxypac | Proxy pac file (can be a URL or a local file). | +| --insecure | Accept insecure SSL connections. | +| --http-backend | Perl library to use for HTTP transactions. Possible values are: lwp (default) and curl. | +| --memcached | Memcached server to use (only one server). | +| --redis-server | Redis server to use (only one server). Syntax: address\[:port\] | +| --redis-attribute | Set Redis Options (--redis-attribute="cnx\_timeout=5"). | +| --redis-db | Set Redis database index. | +| --failback-file | Fall back on a local file if Redis connection fails. | +| --memexpiration | Time to keep data in seconds (default: 86400). | +| --statefile-dir | Define the cache directory (default: '/var/lib/centreon/centplugins'). | +| --statefile-suffix | Define a suffix to customize the statefile name (default: ''). | +| --statefile-concat-cwd | If used with the '--statefile-dir' option, the latter's value will be used as a sub-directory of the current working directory. Useful on Windows when the plugin is compiled, as the file system and permissions are different from Linux. | +| --statefile-format | Define the format used to store the cache. Available formats: 'dumper', 'storable', 'json' (default). | +| --statefile-key | Define the key to encrypt/decrypt the cache. | +| --statefile-cipher | Define the cipher algorithm to encrypt the cache (default: 'AES'). | +| --key-file | Set GCP key file path. | +| --authorization-endpoint | Set GCP authorization endpoint URL (default: 'https://www.googleapis.com/oauth2/v4/token') | +| --monitoring-endpoint | Set GCP monitoring endpoint URL (default: 'https://monitoring.googleapis.com/v3') | +| --scope-endpoint | Set GCP scope endpoint URL (default: 'https://www.googleapis.com/auth/cloud-platform') | +| --zeroed | Set metrics value to 0 if none. Useful when Stackdriver does not return value when not defined. | +| --timeout | Set timeout in seconds (default: 10). | -Cela signifie qu'il n'y a pas de données sur la période. + + -Vous pouvez ajouter ```--zeroed``` à la macro EXTRAOPTIONS du **service** en question afin de forcer le stockage d'un 0 et ainsi éviter un statut UNKNOWN. +Pour un mode, la liste de toutes les options disponibles et leur signification peut être +affichée en ajoutant le paramètre `--help` à la commande : + +```bash +/usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \ + --plugin=cloud::google::gcp::storage::plugin \ + --mode=bucket \ + --help +``` diff --git a/pp/integrations/plugin-packs/procedures/cloud-gcp-storage.md b/pp/integrations/plugin-packs/procedures/cloud-gcp-storage.md index c690a17d04d4..3ad6a56713ff 100644 --- a/pp/integrations/plugin-packs/procedures/cloud-gcp-storage.md +++ b/pp/integrations/plugin-packs/procedures/cloud-gcp-storage.md @@ -5,42 +5,56 @@ title: Google Storage import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Connector dependencies -## Monitoring Connector Assets +The following monitoring connectors will be installed when you install the **Google Storage** connector through the +**Configuration > Monitoring Connector Manager** menu: +* [Base Pack](./base-generic.md) -### Monitored Objects +## Pack assets -The Monitoring Connector Google Storage collects metrics for: -* Bucket +### Templates -### Discovery rules +The Monitoring Connector **Google Storage** brings a host template: + +* **Cloud-Gcp-Storage-custom** + +The connector brings the following service templates (sorted by the host template they are attached to): + + + -The Centreon Monitoring Connector *Google Storage* includes a Host Discovery *provider* to automatically discover storages -for a given Google Cloud Project. +| Service Alias | Service Template | Service Description | +|:--------------|:------------------------------------|:-----------------------------| +| Bucket | Cloud-Gcp-Storage-Bucket-Api-custom | Check storage bucket metrics | + +> The services listed above are created automatically when the **Cloud-Gcp-Storage-custom** host template is used. + + + -This provider is named **Google Storage**: +### Discovery rules -![image](../../../assets/integrations/plugin-packs/procedures/cloud-gcp-storage-provider.png) +#### Host discovery -> Note that the key file must be deployed on the Poller(s) expected to discover GCP assets. +| Rule name | Description | +|:----------------|:------------------------| +| Google Storage | Discover Google Storage | -More information about the Host Discovery module is available in the Centreon documentation: -[Host Discovery](/docs/monitoring/discovery/hosts-discovery) +More information about discovering hosts automatically is available on the [dedicated page](/docs/monitoring/discovery/hosts-discovery). -### Collected Metrics +### Collected metrics & status -For all collected metrics, we can choose the *aggregation*: _average_, _minimum_, _maximum_ and _total_. +Here is the list of services for this connector, detailing all metrics and statuses linked to each service. -| 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 | +| Name | Unit | +|:--------------------------------------|:------| +| storage.bucket.objects.count | count | +| storage.network.received.volume.bytes | B | +| storage.network.sent.volume.bytes | B | @@ -57,112 +71,290 @@ Configure a service account key (download its private key as a JSON file) for wh How to create a service account key: https://developers.google.com/identity/protocols/oauth2/service-account -### Centreon +## Installing the monitoring connector -Deploy the key file on every Poller expected to monitor Google Cloud resources. The key file -should be readable by centreon-engine poller. +### Pack -## Setup +1. If the platform uses an *online* license, you can skip the package installation +instruction below as it is not required to have the connector displayed within the +**Configuration > Monitoring Connector Manager** menu. +If the platform uses an *offline* license, install the package on the **central server** +with the command corresponding to the operating system's package manager: - + -1. Install the Centreon Plugin on every Poller: +```bash +dnf install centreon-pack-cloud-gcp-storage +``` + + + ```bash -yum install centreon-plugin-Cloud-Gcp-Storage-Api +dnf install centreon-pack-cloud-gcp-storage +``` + + + + +```bash +apt install centreon-pack-cloud-gcp-storage ``` -2. On the Centreon Web interface in **Configuration > Monitoring Connector Manager**, install the *Google Storage* Monitoring Connector + + + +```bash +yum install centreon-pack-cloud-gcp-storage +``` - + + +2. Whatever the license type (*online* or *offline*), install the **Google Storage** connector through +the **Configuration > Monitoring Connector Manager** menu. -1. Install the Centreon Plugin on every Poller: +### Plugin + +Since Centreon 22.04, you can benefit from the 'Automatic plugin installation' feature. +When this feature is enabled, you can skip the installation part below. + +You still have to manually install the plugin on the poller(s) when: +- Automatic plugin installation is turned off +- You want to run a discovery job from a poller that doesn't monitor any resource of this kind yet + +> More information in the [Installing the plugin](/docs/monitoring/pluginpacks/#installing-the-plugin) section. + +Use the commands below according to your operating system's package manager: + + + ```bash -yum install centreon-plugin-Cloud-Gcp-Storage-Api +dnf install centreon-plugin-Cloud-Gcp-Storage-Api ``` -2. On the Centreon Central server, install the Centreon Monitoring Connector from the RPM: + + ```bash -yum install centreon-pack-cloud-gcp-storage +dnf install centreon-plugin-Cloud-Gcp-Storage-Api ``` -3. On the Centreon Web interface in **Configuration > Monitoring Connector Manager**, install the *Google Storage* Monitoring Connector + + + +```bash +apt install centreon-plugin-cloud-gcp-storage-api +``` + + + + +```bash +yum install centreon-plugin-Cloud-Gcp-Storage-Api +``` -## Host configuration +## Using the monitoring connector + +### Using a host template provided by the connector + +1. Log into Centreon and add a new host through **Configuration > Hosts**. +2. Fill in the **Name**, **Alias** & **IP Address/DNS** fields according to your resource's settings. +3. Apply the **Cloud-Gcp-Storage-custom** template to the host. A list of macros appears. Macros allow you to define how the connector will connect to the resource, and to customize the connector's behavior. +4. Fill in the macros you want. Some macros are mandatory. -* Add a new Host and apply the *Cloud-Gcp-Storage-custom* Host Template +| Macro | Description | Default value | Mandatory | +|:---------------------|:-----------------------------------------------------------------------------------------------------|:-----------------------------------------------|:-----------:| +| GCPDIMENSIONNAME | Set dimension name (default: 'resource.labels.bucket\_name'). Can be: 'resources.labels.location' | resource.labels.bucket\_name | | +| GCPDIMENSIONOPERATOR | Set dimension operator (default: 'equals'. Can also be: 'regexp', 'starts') | equals | | +| GCPDIMENSIONVALUE | Set dimension value (required) | | | +| GCPKEYFILEPATH | Set GCP key file path | | X | +| GCPSCOPEENDPOINT | Set GCP scope endpoint URL (default: 'https://www.googleapis.com/auth/cloud-platform') | https://www.googleapis.com/auth/cloud-platform | | +| PROXYURL | Proxy URL. Example: http://my.proxy:3128 | | | +| GCPEXTRAOPTIONS | Any extra option you may want to add to every command (a --verbose flag for example). All options are listed [here](#available-options). | | | -> Once the template applied, some Macros have to be configured: +5. [Deploy the configuration](/docs/monitoring/monitoring-servers/deploying-a-configuration). The host appears in the list of hosts, and on the **Resources Status** page. The command that is sent by the connector is displayed in the details panel of the host: it shows the values of the macros. -| 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 | +### Using a service template provided by the connector -> Service account key file must be stored on Centreon Poller. *centreon-engine* user account must have read privileges on that file. +1. If you have used a host template and checked **Create Services linked to the Template too**, the services linked to the template have been created automatically, using the corresponding service templates. Otherwise, [create manually the services you want](/docs/monitoring/basic-objects/services) and apply a service template to them. +2. Fill in the macros you want (e.g. to change the thresholds for the alerts). Some macros are mandatory (see the table below). + + + + +| Macro | Description | Default value | Mandatory | +|:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| TIMEFRAME | Set timeframe in seconds (i.e. 3600 to check last hour) | 900 | | +| AGGREGATION | Define how the data must be aggregated. Available aggregations: 'minimum', 'maximum', 'average', 'total' and 'count'. Can be called multiple times | average | | +| FILTERMETRIC | Filter metrics (can be: 'storage/object\_count', 'network/received\_bytes\_count', 'network/sent\_bytes\_count') (can be a regexp) | | | +| WARNINGBUCKETOBJECTS | Threshold | | | +| CRITICALBUCKETOBJECTS | Threshold | | | +| WARNINGRECEIVEDVOLUME | Threshold | | | +| CRITICALRECEIVEDVOLUME | Threshold | | | +| WARNINGSENTVOLUME | Threshold | | | +| CRITICALSENTVOLUME | Threshold | | | +| EXTRAOPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed [here](#available-options). | --verbose | | + + + -## FAQ +3. [Deploy the configuration](/docs/monitoring/monitoring-servers/deploying-a-configuration). The service appears in the list of services, and on the **Resources Status** page. The command that is sent by the connector is displayed in the details panel of the service: it shows the values of the macros. -### How to test the Plugin and what are the main options for? +## How to check in the CLI that the configuration is OK 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: +Once the plugin is installed, log into your Centreon poller's CLI using the +**centreon-engine** user account (`su - centreon-engine`). Test that the connector +is able to monitor a GCP Instance using a command like this one (replace the sample values by yours): ```bash /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 + --plugin=cloud::google::gcp::storage::plugin \ + --mode=bucket \ + --proxyurl='' \ + --key-file='/var/lib/centreon-engine/centreon-dev-6e5531fc9e82.json' \ + --scope-endpoint='https://www.googleapis.com/auth/cloud-platform' \ + --dimension-name='resource.labels.bucket\_name' \ + --dimension-operator='equals' \ + --dimension-value='' \ + --filter-metric='' \ + --timeframe='900' \ + --aggregation='average' \ + --warning-bucket-objects='' \ + --critical-bucket-objects='' \ + --warning-received-volume='' \ + --critical-received-volume='' \ + --warning-sent-volume='' \ + --critical-sent-volume='' \ + --verbose ``` -Expected command output is shown below: +The expected command output is shown below: ```bash 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'```). +### Troubleshooting + +Please find the [troubleshooting documentation](../getting-started/how-to-guides/troubleshooting-plugins.md) +for Centreon Plugins typical issues. -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'```). +### Available modes -All the options as well as all the available thresholds can be displayed by adding the ```--help``` -parameter to the command: +In most cases, a mode corresponds to a service template. The mode appears in the execution command for the connector. +In the Centreon interface, you don't need to specify a mode explicitly: its use is implied when you apply a service template. +However, you will need to specify the correct mode for the template if you want to test the execution command for the +connector in your terminal. + +All available modes can be displayed by adding the `--list-mode` parameter to +the command: ```bash /usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \ - --plugin=cloud::google::gcp::storage::plugin \ - --mode=bucket \ - --help + --plugin=cloud::google::gcp::storage::plugin \ + --list-mode ``` -### Why do I get the following result ```UNKNOWN: No metrics. Check your options or use --zeroed option to set 0 on undefined values``` ? +The plugin brings the following modes: + +| Mode | Linked service template | +|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------| +| bucket [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/google/gcp/storage/mode/bucket.pm)] | Cloud-Gcp-Storage-Bucket-Api-custom | +| discovery [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/google/gcp/storage/mode/discovery.pm)] | Used for host discovery | + +### Available options + +#### Modes options + +All available options for each service template are listed below: + + + + +| Option | Description | +|:-------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --dimension-name | Set dimension name (default: 'resource.labels.bucket\_name'). Can be: 'resources.labels.location'. | +| --dimension-operator | Set dimension operator (default: 'equals'. Can also be: 'regexp', 'starts'). | +| --dimension-value | Set dimension value (required). | +| --filter-metric | Filter metrics (can be: 'storage/object\_count', 'network/received\_bytes\_count', 'network/sent\_bytes\_count') (can be a regexp). | +| --timeframe | Set timeframe in seconds (i.e. 3600 to check last hour). | +| --aggregation | Define how the data must be aggregated. Available aggregations: 'minimum', 'maximum', 'average', 'total' and 'count'. Can be called multiple times. | +| --warning-* --critical-* | Thresholds (can be: 'bucket-objects', 'received-volume', 'sent-volume'). | +| --per-second | Change the data to be unit/sec. | +| --mode | Define the mode in which you want the plugin to be executed (see --list-mode). | +| --dyn-mode | Specify a mode with the module's path (advanced). | +| --list-mode | List all available modes. | +| --mode-version | Check minimal version of mode. If not, unknown error. | +| --version | Return the version of the plugin. | +| --custommode | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option. | +| --list-custommode | List all available custom modes. | +| --multiple | Multiple custom mode objects. This may be required by some specific modes (advanced). | +| --pass-manager | Define the password manager you want to use. Supported managers are: environment, file, keepass, hashicorpvault and teampass. | +| --verbose | Display extended status information (long output). | +| --debug | Display debug messages. | +| --filter-perfdata | Filter perfdata that match the regexp. Example: adding --filter-perfdata='avg' will remove all metrics that do not contain 'avg' from performance data. | +| --filter-perfdata-adv | Filter perfdata based on a "if" condition using the following variables: label, value, unit, warning, critical, min, max. Variables must be written either %\{variable\} or %(variable). Example: adding --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")' will remove all metrics whose value equals 0 and that don't have a maximum value. | +| --explode-perfdata-max | Create a new metric for each metric that comes with a maximum limit. The new metric will be named identically with a '\_max' suffix). Example: it will split 'used\_prct'=26.93%;0:80;0:90;0;100 into 'used\_prct'=26.93%;0:80;0:90;0;100 'used\_prct\_max'=100%;;;; | +| --change-perfdata --extend-perfdata | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[newuom\],\[min\],\[max\]\] Common examples: =over 4 Convert storage free perfdata into used: --change-perfdata='free,used,invert()' Convert storage free perfdata into used: --change-perfdata='used,free,invert()' Scale traffic values automatically: --change-perfdata='traffic,,scale(auto)' Scale traffic values in Mbps: --change-perfdata='traffic\_in,,scale(Mbps),mbps' Change traffic values in percent: --change-perfdata='traffic\_in,,percent()' =back | +| --extend-perfdata-group | Add new aggregated metrics (min, max, average or sum) for groups of metrics defined by a regex match on the metrics' names. Syntax: --extend-perfdata-group=regex,namesofnewmetrics,calculation\[,\[newuom\],\[min\],\[max\]\] regex: regular expression namesofnewmetrics: how the new metrics' names are composed (can use $1, $2... for groups defined by () in regex). calculation: how the values of the new metrics should be calculated newuom (optional): unit of measure for the new metrics min (optional): lowest value the metrics can reach max (optional): highest value the metrics can reach Common examples: =over 4 Sum wrong packets from all interfaces (with interface need --units-errors=absolute): --extend-perfdata-group=',packets\_wrong,sum(packets\_(discard\|error)\_(in\|out))' Sum traffic by interface: --extend-perfdata-group='traffic\_in\_(.*),traffic\_$1,sum(traffic\_(in\|out)\_$1)' =back | +| --change-short-output --change-long-output | Modify the short/long output that is returned by the plugin. Syntax: --change-short-output=pattern~replacement~modifier Most commonly used modifiers are i (case insensitive) and g (replace all occurrences). Example: adding --change-short-output='OK~Up~gi' will replace all occurrences of 'OK', 'ok', 'Ok' or 'oK' with 'Up' | +| --change-exit | Replace an exit code with one of your choice. Example: adding --change-exit=unknown=critical will result in a CRITICAL state instead of an UNKNOWN state. | +| --range-perfdata | Rewrite the ranges displayed in the perfdata. Accepted values: 0: nothing is changed. 1: if the lower value of the range is equal to 0, it is removed. 2: remove the thresholds from the perfdata. | +| --filter-uom | Mask the units when they don't match the given regular expression. | +| --opt-exit | Replace the exit code in case of an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc). Default: unknown. | +| --output-ignore-perfdata | Remove all the metrics from the service. The service will still have a status and an output. | +| --output-ignore-label | Remove the status label ("OK:", "WARNING:", "UNKNOWN:", CRITICAL:") from the beginning of the output. Example: 'OK: Ram Total:...' will become 'Ram Total:...' | +| --output-xml | Return the output in XML format (to send to an XML API). | +| --output-json | Return the output in JSON format (to send to a JSON API). | +| --output-openmetrics | Return the output in OpenMetrics format (to send to a tool expecting this format). | +| --output-file | Write output in file (can be combined with json, xml and openmetrics options). E.g.: --output-file=/tmp/output.txt will write the output in /tmp/output.txt. | +| --disco-format | Applies only to modes beginning with 'list-'. Returns the list of available macros to configure a service discovery rule (formatted in XML). | +| --disco-show | Applies only to modes beginning with 'list-'. Returns the list of discovered objects (formatted in XML) for service discovery. | +| --float-precision | Define the float precision for thresholds (default: 8). | +| --source-encoding | Define the character encoding of the response sent by the monitored resource Default: 'UTF-8'. =head1 DESCRIPTION B\. =cut | +| --http-peer-addr | Set the address you want to connect to. Useful if hostname is only a vhost, to avoid IP resolution. | +| --proxyurl | Proxy URL. Example: http://my.proxy:3128 | +| --proxypac | Proxy pac file (can be a URL or a local file). | +| --insecure | Accept insecure SSL connections. | +| --http-backend | Perl library to use for HTTP transactions. Possible values are: lwp (default) and curl. | +| --memcached | Memcached server to use (only one server). | +| --redis-server | Redis server to use (only one server). Syntax: address\[:port\] | +| --redis-attribute | Set Redis Options (--redis-attribute="cnx\_timeout=5"). | +| --redis-db | Set Redis database index. | +| --failback-file | Fall back on a local file if Redis connection fails. | +| --memexpiration | Time to keep data in seconds (default: 86400). | +| --statefile-dir | Define the cache directory (default: '/var/lib/centreon/centplugins'). | +| --statefile-suffix | Define a suffix to customize the statefile name (default: ''). | +| --statefile-concat-cwd | If used with the '--statefile-dir' option, the latter's value will be used as a sub-directory of the current working directory. Useful on Windows when the plugin is compiled, as the file system and permissions are different from Linux. | +| --statefile-format | Define the format used to store the cache. Available formats: 'dumper', 'storable', 'json' (default). | +| --statefile-key | Define the key to encrypt/decrypt the cache. | +| --statefile-cipher | Define the cipher algorithm to encrypt the cache (default: 'AES'). | +| --key-file | Set GCP key file path. | +| --authorization-endpoint | Set GCP authorization endpoint URL (default: 'https://www.googleapis.com/oauth2/v4/token') | +| --monitoring-endpoint | Set GCP monitoring endpoint URL (default: 'https://monitoring.googleapis.com/v3') | +| --scope-endpoint | Set GCP scope endpoint URL (default: 'https://www.googleapis.com/auth/cloud-platform') | +| --zeroed | Set metrics value to 0 if none. Useful when Stackdriver does not return value when not defined. | +| --timeout | Set timeout in seconds (default: 10). | -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. +All available options for a given mode can be displayed by adding the +`--help` parameter to the command: + +```bash +/usr/lib/centreon/plugins/centreon_gcp_storage_api.pl \ + --plugin=cloud::google::gcp::storage::plugin \ + --mode=bucket \ + --help +```