From 026aed4130c89e65b82c010299406cc756fced0a Mon Sep 17 00:00:00 2001 From: itoussies Date: Wed, 29 Apr 2026 15:57:39 +0200 Subject: [PATCH] Refresh cloud-aws-cloudwatchlogs --- .../procedures/cloud-aws-cloudwatchlogs.md | 243 +++++++++++------- .../procedures/cloud-aws-cloudwatchlogs.md | 236 ++++++++++------- 2 files changed, 286 insertions(+), 193 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md index 414a9caaa9f0..bb98f556aab0 100644 --- a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md +++ b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md @@ -36,14 +36,14 @@ Le connecteur apporte le modèle de service suivant -Il n'y a pas de modèle de service rattaché à ce modèle d'hôte. +Ce modèle d'hôte n'a pas de modèle de service associé. -| Alias | Modèle de service | Description | -|:------------------------|:---------------------------------------------|:------------------------------| -| Cloudwatchlogs-Get-Logs | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | Supervise les logs CloudWatch | +| Alias | Modèle de service | Description | +|:------------------------|:---------------------------------------------|:------------------| +| Cloudwatchlogs-Get-Logs | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | Contrôle les logs | > Les services listés ci-dessus ne sont pas créés automatiquement lorsqu'un modèle d'hôte est appliqué. Pour les utiliser, [créez un service manuellement](/docs/monitoring/basic-objects/services) et appliquez le modèle de service souhaité. @@ -70,10 +70,10 @@ Voici le tableau des services pour ce connecteur, détaillant les métriques et ### Privilèges AWS -Configurez un compte de service (via une combinaison d'access key et secret key) et affectez-lui les privilèges suivants : +Configurez un compte de service (via une combinaison d'access et secret key) et affectez-lui les privilèges suivants : * CloudWatchLogs:DescribeLogGroups -### Dépendances du Plugin +### Dépendances du plugin Afin de récupérer les informations nécessaires via les APIs AWS, il est possible d'utiliser soit le binaire *awscli* fourni par Amazon, soit le SDK Perl *paws*. Le SDK est recommandé car plus performant. @@ -193,15 +193,17 @@ yum install centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api 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-Aws-CloudWatchLogs-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. - -| Macro | Description | Valeur par défaut | Obligatoire | -|:--------------|:---------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| AWSACCESSKEY | Set AWS access key | | X | -| AWSCUSTOMMODE | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option | awscli | | -| AWSREGION | Set the region name (required) | | X | -| AWSSECRETKEY | Set AWS secret key | | X | -| PROXYURL | Proxy URL if any | | | +4. Renseignez les macros désirées. Attention, certaines macros sont obligatoires, notamment la macro permettant de définir le [custom mode](#custom-modes-disponibles), c'est-à-dire la méthode de connexion à la ressource. + +| Macro | Description | Valeur par défaut | Obligatoire | +|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| AWSACCESSKEY | Set AWS access key | | | +| AWSASSUMEROLE | Set Amazon Resource Name of the role to be assumed | | | +| AWSCUSTOMMODE | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option | awscli | | +| AWSREGION | Set the region name | | X | +| AWSSECRETKEY | Set AWS secret key | | | +| PROXYURL | Proxy URL if any | | | +| EXTRAOPTIONS | 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). | | | 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. @@ -213,15 +215,15 @@ yum install centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api -| Macro | Description | Valeur par défaut | Obligatoire | -|:---------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| GROUPNAME | Set log group name (required) | | | -| STREAMNAME | Filters the results to only logs from the log stream (multiple option) | | | -| STARTTIMESINCE | Lookup logs last X seconds ago. If not set: lookup logs since the last execution | | | -| UNKNOWNSTATUS | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| WARNINGSTATUS | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| 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 | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:---------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| GROUPNAME | Set log group name | | X | +| STREAMNAME | Filters the results to only logs from the log stream (multiple option) | | | +| STARTTIMESINCE | Lookup logs last X seconds ago. If not set: lookup logs since the last execution | | | +| UNKNOWNSTATUS | Define the conditions to match for the status to be UNKNOWN You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| WARNINGSTATUS | Define the conditions to match for the status to be WARNING You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| 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 | | @@ -286,13 +288,75 @@ Tous les modes disponibles peuvent être affichés en ajoutant le paramètre Le plugin apporte les modes suivants : -| Mode | Modèle de service associé | -|:--------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------| -| get-logs [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm)] | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | -| list-groups [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/listgroups.pm)] | Not used in this Monitoring Connector | +| Mode | Modèle de service associé | +|:--------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------| +| get-logs [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm)] | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | +| list-groups [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/listgroups.pm)] | Non utilisé dans ce connecteur de supervision | + +### Custom modes disponibles + +Ce connecteur offre plusieurs méthodes pour se connecter à la ressource (CLI, bibliothèque, etc.), appelées **custom modes**. +Tous les custom modes disponibles peuvent être affichés en ajoutant le paramètre +`--list-custommode` à la commande : + +```bash +/usr/lib/centreon/plugins/centreon_aws_cloudwatchlogs_api.pl \ + --plugin=cloud::aws::cloudwatchlogs::plugin \ + --list-custommode +``` + +Le plugin apporte les custom modes suivants : + +* paws +* awscli ### Options disponibles +#### Options des custom modes + +Les options spécifiques aux **custom modes** sont listées ci-dessous : + + + + +| Option | Description | +|:--------------------|:-----------------------------------------------------------------------------------------------| +| --aws-secret-key | Set AWS secret key. | +| --aws-access-key | Set AWS access key. | +| --aws-session-token | Set AWS session token. | +| --aws-role-arn | Set arn of the role to be assumed. | +| --region | Set the region name . | +| --period | Set period in seconds. | +| --timeframe | Set timeframe in seconds. | +| --statistic | Set cloudwatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | +| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | +| --proxyurl | Proxy URL if any | + + + +| Option | Description | +|:--------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --aws-secret-key | Set AWS secret key. | +| --aws-access-key | Set AWS access key. | +| --aws-session-token | Set AWS session token. | +| --aws-role-arn | Set Amazon Resource Name of the role to be assumed. | +| --aws-profile | Set AWS profile. | +| --endpoint-url | Override AWS service endpoint URL if necessary. | +| --region | Set the region name . | +| --period | Set period in seconds. | +| --timeframe | Set timeframe in seconds. | +| --statistic | Set CloudWatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | +| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | +| --timeout | Set timeout in seconds (default: 50). | +| --sudo | Use 'sudo' to execute the command. | +| --command | Command to get information (default: 'aws'). Can be changed if you have output in a file. | +| --command-path | Command path (default: none). | +| --command-options | Command options (default: none). Only use for testing purpose, when you want to set ALL parameters of a command by yourself. | +| --proxyurl | Proxy URL if any | +| --skip-ssl-check | Avoid certificate issuer verification. Useful when AWS resources are hosted by a third party. Note that it strips all stderr from the command result. Debug will only display CLI instead of everything. | + + + #### Options des modes Les options disponibles pour chaque modèle de services sont listées ci-dessous : @@ -300,76 +364,59 @@ Les options disponibles pour chaque modèle de services sont listées ci-dessous -| Option | Description | -|:-------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | -| --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 | Failback 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'). | -| --group-name | Set log group name (required). | -| --stream-name | Filters the results to only logs from the log stream (multiple option). | -| --start-time-since | Lookup logs last X seconds ago. If not set: lookup logs since the last execution. | -| --unknown-status | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --warning-status | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --critical-status | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --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 | -| --aws-secret-key | Set AWS secret key. | -| --aws-access-key | Set AWS access key. | -| --aws-session-token | Set AWS session token. | -| --aws-role-arn | Set Amazon Resource Name of the role to be assumed. | -| --region | Set the region name (required). | -| --period | Set period in seconds. | -| --timeframe | Set timeframe in seconds. | -| --statistic | Set CloudWatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | -| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | -| --proxyurl | Proxy URL if any | -| --aws-profile | Set AWS profile. | -| --endpoint-url | Override AWS service endpoint URL if necessary. | -| --timeout | Set timeout in seconds (default: 50). | -| --sudo | Use 'sudo' to execute the command. | -| --command | Command to get information (default: 'aws'). Can be changed if you have output in a file. | -| --command-path | Command path (default: none). | -| --command-options | Command options (default: none). Only use for testing purpose, when you want to set ALL parameters of a command by yourself. | -| --skip-ssl-check | Avoid certificate issuer verification. Useful when AWS resources are hosted by a third party. Note that it strips all stderr from the command result. Debug will only display CLI instead of everything. | +| Option | Description | +|:-------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --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'). | +| --group-name | Set log group name . | +| --stream-name | Filters the results to only logs from the log stream (multiple option). | +| --start-time-since | Lookup logs last X seconds ago. If not set: lookup logs since the last execution. | +| --unknown-status | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --warning-status | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --critical-status | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --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\[,\[\\],\[min\],\[max\]\] Common examples: onvert 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,\,calculation\[,\[\\],\[min\],\[max\]\] regex: regular expression \: 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 \ (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: um 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. | +| --change-output-adv | Replace short output and exit code based on a "if" condition using the following variables: short\_output, exit\_code. Variables must be written either %\{variable\} or %(variable). Example: adding --change-output-adv='%(short\_ouput) =~ /UNKNOWN: No daemon/,OK: No daemon,OK' will change the following specific UNKNOWN result to an OK result. | +| --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). Example: --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'. \. | diff --git a/pp/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md b/pp/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md index 7c191c6d3b80..ed7cd6565861 100644 --- a/pp/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md +++ b/pp/integrations/plugin-packs/procedures/cloud-aws-cloudwatchlogs.md @@ -33,14 +33,14 @@ The connector brings the following service templates (sorted by the host templat -No service template is linked to this host template. +This host template doesn't have any associated services. | Service Alias | Service Template | Service Description | |:------------------------|:---------------------------------------------|:----------------------| -| Cloudwatchlogs-Get-Logs | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | Check CloudWatch logs | +| Cloudwatchlogs-Get-Logs | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | Check Cloudwatch logs | > The services listed above are not created automatically when a host template is applied. To use them, [create a service manually](/docs/monitoring/basic-objects/services), then apply the service template you want. @@ -54,9 +54,9 @@ Here is the list of services for this connector, detailing all metrics and statu -| Name | Unit | -|:-------|:------| -| status | N/A | +| Name | Unit | +|:-------|:-----| +| status | N/A | > To obtain this new metric format, include **--use-new-perfdata** in the **EXTRAOPTIONS** service macro. @@ -99,8 +99,7 @@ sudo ./aws/install ### Pack - The installation procedures for monitoring connectors are slightly different depending on [whether your license is offline or online](../getting-started/how-to-guides/connectors-licenses.md). - +The installation procedures for monitoring connectors are slightly different depending on [whether your license is offline or online](../getting-started/how-to-guides/connectors-licenses.md). 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 @@ -193,15 +192,17 @@ yum install centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api 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-Aws-CloudWatchLogs-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. - -| Macro | Description | Default value | Mandatory | -|:--------------|:---------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| AWSACCESSKEY | Set AWS access key | | X | -| AWSCUSTOMMODE | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option | awscli | | -| AWSREGION | Set the region name (required) | | X | -| AWSSECRETKEY | Set AWS secret key | | X | -| PROXYURL | Proxy URL if any | | | +4. Fill in the macros you want. Some macros are mandatory, in particular the macro for defining the [custom mode](#available-custom-modes), i.e. the connection method to the resource. + +| Macro | Description | Default value | Mandatory | +|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|:---------:| +| AWSACCESSKEY | Set AWS access key | | | +| AWSASSUMEROLE | Set Amazon Resource Name of the role to be assumed | | | +| AWSCUSTOMMODE | When a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this option | awscli | | +| AWSREGION | Set the region name | | X | +| AWSSECRETKEY | Set AWS secret key | | | +| PROXYURL | Proxy URL if any | | | +| EXTRAOPTIONS | Any extra option you may want to add to every command (a --verbose flag for example). All options are listed [here](#available-options). | | | 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. @@ -213,15 +214,15 @@ yum install centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api -| Macro | Description | Default value | Mandatory | -|:---------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| GROUPNAME | Set log group name (required) | | | -| STREAMNAME | Filters the results to only logs from the log stream (multiple option) | | | -| STARTTIMESINCE | Lookup logs last X seconds ago. If not set: lookup logs since the last execution | | | -| UNKNOWNSTATUS | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| WARNINGSTATUS | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | | | -| 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 | | +| Macro | Description | Default value | Mandatory | +|:---------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|:---------:| +| GROUPNAME | Set log group name | | X | +| STREAMNAME | Filters the results to only logs from the log stream (multiple option) | | | +| STARTTIMESINCE | Lookup logs last X seconds ago. If not set: lookup logs since the last execution | | | +| UNKNOWNSTATUS | Define the conditions to match for the status to be UNKNOWN You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| WARNINGSTATUS | Define the conditions to match for the status to be WARNING You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | | | +| 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 | | @@ -289,8 +290,70 @@ The plugin brings the following modes: | get-logs [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm)] | Cloud-Aws-Cloudwatchlogs-Get-Logs-Api-custom | | list-groups [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/cloud/aws/cloudwatchlogs/mode/listgroups.pm)] | Not used in this Monitoring Connector | +### Available custom modes + +This connector offers several ways to connect to the resource (CLI, library, etc.), called **custom modes**. +All available custom modes can be displayed by adding the `--list-custommode` parameter to +the command: + +```bash +/usr/lib/centreon/plugins/centreon_aws_cloudwatchlogs_api.pl \ + --plugin=cloud::aws::cloudwatchlogs::plugin \ + --list-custommode +``` + +The plugin brings the following custom modes: + +* paws +* awscli + ### Available options +#### Custom modes options + +All **custom modes** specific options are listed here: + + + + +| Option | Description | +|:--------------------|:-----------------------------------------------------------------------------------------------| +| --aws-secret-key | Set AWS secret key. | +| --aws-access-key | Set AWS access key. | +| --aws-session-token | Set AWS session token. | +| --aws-role-arn | Set arn of the role to be assumed. | +| --region | Set the region name . | +| --period | Set period in seconds. | +| --timeframe | Set timeframe in seconds. | +| --statistic | Set cloudwatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | +| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | +| --proxyurl | Proxy URL if any | + + + +| Option | Description | +|:--------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --aws-secret-key | Set AWS secret key. | +| --aws-access-key | Set AWS access key. | +| --aws-session-token | Set AWS session token. | +| --aws-role-arn | Set Amazon Resource Name of the role to be assumed. | +| --aws-profile | Set AWS profile. | +| --endpoint-url | Override AWS service endpoint URL if necessary. | +| --region | Set the region name . | +| --period | Set period in seconds. | +| --timeframe | Set timeframe in seconds. | +| --statistic | Set CloudWatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | +| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | +| --timeout | Set timeout in seconds (default: 50). | +| --sudo | Use 'sudo' to execute the command. | +| --command | Command to get information (default: 'aws'). Can be changed if you have output in a file. | +| --command-path | Command path (default: none). | +| --command-options | Command options (default: none). Only use for testing purpose, when you want to set ALL parameters of a command by yourself. | +| --proxyurl | Proxy URL if any | +| --skip-ssl-check | Avoid certificate issuer verification. Useful when AWS resources are hosted by a third party. Note that it strips all stderr from the command result. Debug will only display CLI instead of everything. | + + + #### Modes options All available options for each service template are listed below: @@ -298,76 +361,59 @@ 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$' | -| --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 | Failback 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'). | -| --group-name | Set log group name (required). | -| --stream-name | Filters the results to only logs from the log stream (multiple option). | -| --start-time-since | Lookup logs last X seconds ago. If not set: lookup logs since the last execution. | -| --unknown-status | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --warning-status | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --critical-status | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream_name\}, %\{since\} | -| --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 | -| --aws-secret-key | Set AWS secret key. | -| --aws-access-key | Set AWS access key. | -| --aws-session-token | Set AWS session token. | -| --aws-role-arn | Set Amazon Resource Name of the role to be assumed. | -| --region | Set the region name (required). | -| --period | Set period in seconds. | -| --timeframe | Set timeframe in seconds. | -| --statistic | Set CloudWatch statistics (can be: 'minimum', 'maximum', 'average', 'sum'). | -| --zeroed | Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. | -| --proxyurl | Proxy URL if any | -| --aws-profile | Set AWS profile. | -| --endpoint-url | Override AWS service endpoint URL if necessary. | -| --timeout | Set timeout in seconds (default: 50). | -| --sudo | Use 'sudo' to execute the command. | -| --command | Command to get information (default: 'aws'). Can be changed if you have output in a file. | -| --command-path | Command path (default: none). | -| --command-options | Command options (default: none). Only use for testing purpose, when you want to set ALL parameters of a command by yourself. | -| --skip-ssl-check | Avoid certificate issuer verification. Useful when AWS resources are hosted by a third party. Note that it strips all stderr from the command result. Debug will only display CLI instead of everything. | +| Option | Description | +|:-------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --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'). | +| --group-name | Set log group name . | +| --stream-name | Filters the results to only logs from the log stream (multiple option). | +| --start-time-since | Lookup logs last X seconds ago. If not set: lookup logs since the last execution. | +| --unknown-status | Define the conditions to match for the status to be UNKNOWN (default: '') You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --warning-status | Define the conditions to match for the status to be WARNING (default: '') You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --critical-status | Define the conditions to match for the status to be CRITICAL (default: ''). You can use the following variables: %\{message\}, %\{stream\_name\}, %\{since\} | +| --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\[,\[\\],\[min\],\[max\]\] Common examples: onvert 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,\,calculation\[,\[\\],\[min\],\[max\]\] regex: regular expression \: 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 \ (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: um 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. | +| --change-output-adv | Replace short output and exit code based on a "if" condition using the following variables: short\_output, exit\_code. Variables must be written either %\{variable\} or %(variable). Example: adding --change-output-adv='%(short\_ouput) =~ /UNKNOWN: No daemon/,OK: No daemon,OK' will change the following specific UNKNOWN result to an OK result. | +| --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). Example: --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'. \. |