diff --git a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/applications-databases-mongodb.md b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/applications-databases-mongodb.md index 1ecb21eb80e7..f60be1f6b5b3 100644 --- a/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/applications-databases-mongodb.md +++ b/i18n/fr/docusaurus-plugin-content-docs-pp/current/integrations/plugin-packs/procedures/applications-databases-mongodb.md @@ -5,6 +5,12 @@ title: MongoDB import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Dépendances du connecteur de supervision + +Les connecteurs de supervision suivants sont automatiquement installés lors de l'installation du connecteur **MongoDB** +depuis la page **Configuration > Connecteurs > Connecteurs de supervision** : +* [Base Pack](./base-generic.md) + ## Contenu du pack ### Modèles @@ -21,10 +27,10 @@ Le connecteur apporte les modèles de service suivants | Alias | Modèle de service | Description | Découverte | |:----------------------|:--------------------------------------------|:----------------------------------------------------------------|:----------:| -| Collection-Statistics | App-DB-Mongodb-Collection-Statistics-custom | Contrôle les statistiques des collections, par base de données | X | +| Collection-Statistics | App-DB-Mongodb-Collection-Statistics-custom | Contrôle les statistiques des collections, par base de données | X | | Connection-Time | App-DB-Mongodb-Connection-Time-custom | Contrôle le temps de connexion à l'instance | | | Connections | App-DB-Mongodb-Connections-custom | Contrôle le nombre de connexions | | -| Database-Statistics | App-DB-Mongodb-Database-Statistics-custom | Contrôle les statistiques des bases de données | X | +| Database-Statistics | App-DB-Mongodb-Database-Statistics-custom | Contrôle les statistiques des bases de données | X | | Queries | App-DB-Mongodb-Queries-custom | Contrôle le nombre de requêtes par secondes | | > Les services listés ci-dessus sont créés automatiquement lorsque le modèle d'hôte **App-DB-Mongodb-custom** est utilisé. @@ -45,100 +51,95 @@ Le connecteur apporte les modèles de service suivants ### Règles de découverte -#### Découverte de service +#### Découverte de services | Nom de la règle | Description | |:-------------------------------------|:-------------------------------------------------------------------------| | App-DB-Mongodb-Collection-Statistics | Découvre les bases de données et supervise l'utilisation des collections | -| App-DB-Mongodb-Database-Statistics | Découvre les bases de données et supervise l'utilisation | +| App-DB-Mongodb-Database-Statistics | Découvre les bases de données et en supervise l'utilisation | Rendez-vous sur la [documentation dédiée](/docs/monitoring/discovery/services-discovery) pour en savoir plus sur la découverte automatique de services et sa [planification](/docs/monitoring/discovery/services-discovery/#règles-de-découverte). ### Métriques & statuts collectés -Voici le tableau des services pour ce connecteur, détaillant les métriques rattachées à chaque service. +Voici le tableau des services pour ce connecteur, détaillant les métriques et statuts rattachés à chaque service. -| Métrique | Unité | -|:-------------------------------------------------------------------|:------| -| *db_name~collection_name*#collection.size.storage.bytes | B | -| *db_name~collection_name*#collection.size.index.bytes | B | -| *db_name~collection_name*#collection.documents.count | | -| *db_name~collection_name*#collection.indexes.count | | -| *db_name~collection_name~shard_name*#collection.size.storage.bytes | B | -| *db_name~collection_name~shard_name*#collection.size.index.bytes | B | -| *db_name~collection_name~shard_name*#collection.documents.count | | -| *db_name~collection_name~shard_name*##collection.indexes.count | | +| Nom | Unité | +|:--------------------------------------------------------|:------| +| *databases*~*collections*#collection.size.storage.bytes | B | +| *databases*~*collections*#collection.size.index.bytes | B | +| *databases*~*collections*#collection.documents.count | count | +| *databases*~*collections*#collection.indexes.count | count | +| *databases*~*shards*#collection.size.storage.bytes | B | +| *databases*~*shards*#collection.size.index.bytes | B | +| *databases*~*shards*#collection.documents.count | count | +| *databases*~*shards*#collection.indexes.count | count | -| Métrique | Unité | +| Nom | Unité | |:-----------------------------|:------| | connection.time.milliseconds | ms | -| Métrique | Unité | -|:------------------------------|:------| -| connections.active.count | | -| connections.current.count | | -| connections.usage.percentage | % | -| connections.created.persecond | | +| Nom | Unité | +|:-----------------------------|:------| +| connections.active.count | count | +| connections.current.count | count | +| connections.usage.percentage | % | +| total-created | N/A | -| Métrique | Unité | -|:-------------------------------------------------|:------| -| *db_name*#database.size.storage.bytes | B | -| *db_name*#database.size.data.bytes | B | -| *db_name*#database.size.index.bytes | B | -| *db_name*#database.collections.count | | -| *db_name*#database.views.count | | -| *db_name*#database.documents.count | | -| *db_name*#database.indexes.count | | -| *db_name~shard_name*#database.size.storage.bytes | B | -| *db_name~shard_name*#database.size.data.bytes | B | -| *db_name~shard_name*#database.size.index.bytes | B | -| *db_name~shard_name*#database.collections.count | | -| *db_name~shard_name*#database.views.count | | -| *db_name~shard_name*#database.documents.count | | -| *db_name~shard_name*#database.indexes.count | | +| Nom | Unité | +|:----------------------------------------|:------| +| *databases*#database.size.storage.bytes | B | +| *databases*#database.size.data.bytes | B | +| *databases*#database.size.index.bytes | B | +| *databases*#database.collections.count | count | +| *databases*#database.views.count | count | +| *databases*#database.documents.count | count | +| *databases*#database.indexes.count | count | +| *shards*#database.size.storage.bytes | B | +| *shards*#database.size.data.bytes | B | +| *shards*#database.size.index.bytes | B | +| *shards*#database.collections.count | count | +| *shards*#database.views.count | count | +| *shards*#database.documents.count | count | +| *shards*#database.indexes.count | count | -| Métrique | Unité | +| Nom | Unité | |:--------------------------|:------| -| queries.total.persecond | | -| queries.insert.persecond | | -| queries.insert.count | | -| queries.query.persecond | | -| queries.query.count | | -| queries.update.persecond | | -| queries.update.count | | -| queries.delete.persecond | | -| queries.delete.count | | -| queries.getmore.persecond | | -| queries.getmore.count | | -| queries.command.persecond | | -| queries.command.count | | +| queries.total.persecond | /s | +| queries.insert.persecond | /s | +| queries.query.persecond | /s | +| queries.update.persecond | /s | +| queries.delete.persecond | /s | +| queries.getmore.persecond | /s | +| queries.command.persecond | /s | -| Métrique | Unité | -|:--------------------------------------|:------| -| member status | | -| members.primary.count | | -| members.secondary.count | | -| members.arbiter.count | | -| *member_name*#replication.lag.seconds | s | +| Nom | Unité | +|:----------------------------------|:------| +| status | N/A | +| members.primary.count | count | +| members.secondary.count | count | +| members.arbiter.count | count | +| member-status | N/A | +| *members*#replication.lag.seconds | s | @@ -160,8 +161,6 @@ Voici la liste des privilèges utilisateur nécessaires par service : ### Pack -La procédure d'installation des connecteurs de supervision diffère légèrement [suivant que votre licence est offline ou online](../getting-started/how-to-guides/connectors-licenses.md). - 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 > Connecteurs > Connecteurs de supervision**. Au contraire, si la plateforme utilise une licence *offline*, installez le paquet @@ -253,13 +252,13 @@ yum install centreon-plugin-Applications-Databases-Mongodb 3. Appliquez le modèle d'hôte **App-DB-Mongodb-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 | -|:----------------|:------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| MONGODBUSERNAME | MongoDB username | | X | -| MONGODBPASSWORD | MongoDB password | | X | -| MONGODBPROTOCOL | Protocol used (Default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | mongodb | | -| MONGODBPORT | Port used by MongoDB | 27017 | | -| EXTRAOPTIONS | Any extra option you may want to add to every command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:----------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| MONGODBUSERNAME | MongoDB username | | | +| MONGODBPASSWORD | MongoDB password | | | +| MONGODBPROTOCOL | Protocol used DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | mongodb | | +| MONGODBPORT | Port used by MongoDB | 27017 | | +| 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. @@ -271,101 +270,101 @@ yum install centreon-plugin-Applications-Databases-Mongodb -| Macro | Description | Valeur par défaut | Obligatoire | -|:------------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERDATABASE | Filter databases by name (Can use regexp) | | | -| FILTERCOUNTERS | | | | -| WARNINGCOLLECTIONDOCUMENTS | Thresholds | | | -| CRITICALCOLLECTIONDOCUMENTS | Thresholds | | | -| WARNINGCOLLECTIONINDEXES | Thresholds | | | -| CRITICALCOLLECTIONINDEXES | Thresholds | | | -| WARNINGCOLLECTIONSIZEINDEX | Thresholds | | | -| CRITICALCOLLECTIONSIZEINDEX | Thresholds | | | -| WARNINGCOLLECTIONSIZESTORAGE | Thresholds | | | -| CRITICALCOLLECTIONSIZESTORAGE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| FILTERDATABASE | Filter databases by name (can use regexp) | | | +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGCOLLECTIONDOCUMENTS | Threshold | | | +| CRITICALCOLLECTIONDOCUMENTS | Threshold | | | +| WARNINGCOLLECTIONINDEXES | Threshold | | | +| CRITICALCOLLECTIONINDEXES | Threshold | | | +| WARNINGCOLLECTIONSIZEINDEX | Threshold | | | +| CRITICALCOLLECTIONSIZEINDEX | Threshold | | | +| WARNINGCOLLECTIONSIZESTORAGE | Threshold | | | +| CRITICALCOLLECTIONSIZESTORAGE | 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). | | | -| Macro | Description | Valeur par défaut | Obligatoire | -|:-----------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| WARNINGCONNECTIONTIME | Thresholds | | | -| CRITICALCONNECTIONTIME | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:-----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| WARNINGCONNECTIONTIME | Threshold | | | +| CRITICALCONNECTIONTIME | 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). | | | -| Macro | Description | Valeur par défaut | Obligatoire | -|:-----------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERCOUNTERS | | | | -| WARNINGACTIVE | Thresholds | | | -| CRITICALACTIVE | Thresholds | | | -| WARNINGCONNECTIONSPERSECOND | Thresholds | | | -| CRITICALCONNECTIONSPERSECOND | Thresholds | | | -| WARNINGCURRENT | Thresholds | | | -| CRITICALCURRENT | Thresholds | | | -| WARNINGUSAGE | Thresholds | | | -| CRITICALUSAGE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:-----------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGACTIVE | Threshold | | | +| CRITICALACTIVE | Threshold | | | +| WARNINGCONNECTIONSPERSECOND | Threshold | | | +| CRITICALCONNECTIONSPERSECOND | Threshold | | | +| WARNINGCURRENT | Threshold | | | +| CRITICALCURRENT | Threshold | | | +| WARNINGUSAGE | Threshold | | | +| CRITICALUSAGE | 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). | | | -| Macro | Description | Valeur par défaut | Obligatoire | -|:----------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERDATABASE | Filter databases by name (Can use regexp) | | | -| FILTERCOUNTERS | | | | -| WARNINGDATABASECOLLECTIONS | Thresholds | | | -| CRITICALDATABASECOLLECTIONS | Thresholds | | | -| WARNINGDATABASEDOCUMENTS | Thresholds | | | -| CRITICALDATABASEDOCUMENTS | Thresholds | | | -| WARNINGDATABASEINDEXES | Thresholds | | | -| CRITICALDATABASEINDEXES | Thresholds | | | -| WARNINGDATABASESIZEDATA | Thresholds | | | -| CRITICALDATABASESIZEDATA | Thresholds | | | -| WARNINGDATABASESIZEINDEX | Thresholds | | | -| CRITICALDATABASESIZEINDEX | Thresholds | | | -| WARNINGDATABASESIZESTORAGE | Thresholds | | | -| CRITICALDATABASESIZESTORAGE | Thresholds | | | -| WARNINGDATABASEVIEWS | Thresholds | | | -| CRITICALDATABASEVIEWS | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:----------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| FILTERDATABASE | Filter databases by name (can use regexp) | | | +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGDATABASECOLLECTIONS | Threshold | | | +| CRITICALDATABASECOLLECTIONS | Threshold | | | +| WARNINGDATABASEDOCUMENTS | Threshold | | | +| CRITICALDATABASEDOCUMENTS | Threshold | | | +| WARNINGDATABASEINDEXES | Threshold | | | +| CRITICALDATABASEINDEXES | Threshold | | | +| WARNINGDATABASESIZEDATA | Threshold | | | +| CRITICALDATABASESIZEDATA | Threshold | | | +| WARNINGDATABASESIZEINDEX | Threshold | | | +| CRITICALDATABASESIZEINDEX | Threshold | | | +| WARNINGDATABASESIZESTORAGE | Threshold | | | +| CRITICALDATABASESIZESTORAGE | Threshold | | | +| WARNINGDATABASEVIEWS | Threshold | | | +| CRITICALDATABASEVIEWS | 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). | | | -| Macro | Description | Valeur par défaut | Obligatoire | -|:----------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| WARNINGCOMMAND | Thresholds | | | -| CRITICALCOMMAND | Thresholds | | | -| WARNINGDELETE | Thresholds | | | -| CRITICALDELETE | Thresholds | | | -| WARNINGGETMORE | Thresholds | | | -| CRITICALGETMORE | Thresholds | | | -| WARNINGINSERT | Thresholds | | | -| CRITICALINSERT | Thresholds | | | -| WARNINGQUERY | Thresholds | | | -| CRITICALQUERY | Thresholds | | | -| WARNINGTOTAL | Thresholds | | | -| CRITICALTOTAL | Thresholds | | | -| WARNINGUPDATE | Thresholds | | | -| CRITICALUPDATE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:----------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| WARNINGCOMMAND | Threshold | | | +| CRITICALCOMMAND | Threshold | | | +| WARNINGDELETE | Threshold | | | +| CRITICALDELETE | Threshold | | | +| WARNINGGETMORE | Threshold | | | +| CRITICALGETMORE | Threshold | | | +| WARNINGINSERT | Threshold | | | +| CRITICALINSERT | Threshold | | | +| WARNINGQUERY | Threshold | | | +| CRITICALQUERY | Threshold | | | +| WARNINGTOTAL | Threshold | | | +| CRITICALTOTAL | Threshold | | | +| WARNINGUPDATE | Threshold | | | +| CRITICALUPDATE | 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). | | | -| Macro | Description | Valeur par défaut | Obligatoire | -|:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|:-----------:| -| WARNINGMEMBERSTATUS | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\} | %\{state\} !~ /PRIMARY\|SECONDARY/ | | -| CRITICALMEMBERSTATUS | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\} | %\{health\} !~ /up/ | | -| WARNINGREPLICATIONLAG | Thresholds | | | -| CRITICALREPLICATIONLAG | Thresholds | | | -| WARNINGSTATUS | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync_host\} | | | -| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync_host\} | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). Toutes les options sont listées [ici](#options-disponibles) | | | +| Macro | Description | Valeur par défaut | Obligatoire | +|:-----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------:| +| WARNINGMEMBERSTATUS | Define the conditions to match for the status to be WARNING You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\} | %\{state\} !~ /PRIMARY\|SECONDARY/ | | +| CRITICALMEMBERSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\} | %\{health\} !~ /up/ | | +| WARNINGREPLICATIONLAG | Threshold | | | +| CRITICALREPLICATIONLAG | Threshold | | | +| WARNINGSTATUS | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync\_host\} | | | +| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync\_host\} | | | +| 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). | | | @@ -385,11 +384,16 @@ telle que celle-ci (remplacez les valeurs d'exemple par les vôtres) : --plugin=database::mongodb::plugin \ --mode=replication-status \ --hostname=10.0.0.1 \ - --username='myuser' \ - --password='******' \ + --username='XXX' \ + --password='XXX' \ --port='27017' \ --protocol='mongodb' \ - --verbose + --warning-status='' \ + --critical-status='' \ + --warning-member-status='%\{state\} !~ /PRIMARY|SECONDARY/' \ + --critical-member-status='%\{health\} !~ /up/' \ + --warning-instance-replication-lag-seconds='' \ + --critical-instance-replication-lag-seconds='' ``` La commande devrait retourner un message de sortie similaire à : @@ -430,7 +434,7 @@ Le plugin apporte les modes suivants : | connection-time [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/connectiontime.pm)] | App-DB-Mongodb-Connection-Time-custom | | connections [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/connections.pm)] | App-DB-Mongodb-Connections-custom | | database-statistics [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/databasestatistics.pm)] | App-DB-Mongodb-Database-Statistics-custom | -| list-databases [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/listdatabases.pm)] | Used for service discovery | +| list-databases [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/listdatabases.pm)] | Utilisé pour la découverte de services | | queries [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/queries.pm)] | App-DB-Mongodb-Queries-custom | | replication-status [[code](https://github.com/centreon/centreon-plugins/blob/develop/src/database/mongodb/mode/replicationstatus.pm)] | App-DB-Mongodb-Replication-Status-custom | @@ -440,47 +444,53 @@ Le plugin apporte les modes suivants : Les options génériques sont listées ci-dessous : -| Option | Description | -|:-------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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. Eg: 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). Eg: 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). Eg: 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\],\[m ax\]\] Common examples: 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() | -| --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\[,\[ne wuom\],\[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: 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(traf fic\_(in\|out)\_$1)' | -| --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). Eg: 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. Eg: 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. Eg: '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'. MongoDB driver | -| --hostname | MongoDB server hostname. | -| --port | Port used by MongoDB. | -| --protocol | Protocol used (Default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | -| --username | MongoDB username. | -| --password | MongoDB password. | -| --timeout | Set timeout in seconds (Default: 10). | -| --ssl-opt | Set SSL Options (--ssl-opt="SSL\_version =\> 'TLSv1'" --ssl-opt="SSL\_verify\_mode =\> SSL\_VERIFY\_NONE"). | -| --no-ssl | Don't use ssl connection. | +| Option | Description | +|:-------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --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: =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 | +| --change-perfdata | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[\\],\[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 | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[\\],\[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,\,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: =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-short-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-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'. =head1 DESCRIPTION B\. =cut | +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --hostname | MongoDB server hostname. | +| --port | Port used by MongoDB. | +| --protocol | Protocol used (default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | +| --username | MongoDB username. | +| --password | MongoDB password. | +| --timeout | Set timeout in seconds (default: 10). | +| --ssl-opt | Set SSL Options (--ssl-opt="SSL\_version =\> 'TLSv1'" --ssl-opt="SSL\_verify\_mode =\> SSL\_VERIFY\_NONE"). | +| --no-ssl | Don't use ssl connection. | #### Options des modes @@ -489,79 +499,55 @@ Les options disponibles pour chaque modèle de services sont listées ci-dessous -| Option | Description | -|:-------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------| -| --filter-database | Filter databases by name (Can use regexp). | -| --filter-shard | Filter shards by name (Can use regexp). | -| --add-shards | Add collection statistics by shards. | -| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'index-size', 'documents', 'indexes', 'shard-storage-size', 'shard-index-size', 'shard-documents', 'shard-indexes'. | +| Option | Description | +|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-database | Filter databases by name (can use regexp). | +| --filter-shard | Filter shards by name (can use regexp). | +| --add-shards | Add collection statistics by shards. | +| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'index-size', 'documents', 'indexes', 'shard-storage-size', 'shard-index-size', 'shard-documents', 'shard-indexes'. | -| Option | Description | -|:---------------------------|:---------------------------------------| -| --warning-connection-time | Warning threshold in milliseconds. | -| --critical-connection-time | Critical threshold in milliseconds. | +| Option | Description | +|:---------------------------|:-----------------------------------------| +| --warning-connection-time | Warning threshold in milliseconds. | +| --critical-connection-time | Critical threshold in milliseconds. | -| Option | Description | -|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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 failed. | -| --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'). | -| --warning-* --critical-* | Thresholds. Can be: 'active', 'current', 'usage', 'total-created'. | +| Option | Description | +|:-------------------------|:------------------------------------------------------------------------| +| --warning-* --critical-* | Thresholds. Can be: 'active', 'current', 'usage', 'total-created'. | -| Option | Description | -|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --filter-database | Filter databases by name (Can use regexp). | -| --filter-shard | Filter shards by name (Can use regexp). | -| --add-shards | Add database statistics by shards. | -| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'data-size', 'index-size', 'collections', 'views', 'documents', 'indexes', 'shard-storage-size', 'shard-data-size', 'shard-index-size', 'shard-collections', 'shard-views', 'shard-documents', 'shard-indexes'. | +| Option | Description | +|:-------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-database | Filter databases by name (can use regexp). | +| --filter-shard | Filter shards by name (can use regexp). | +| --add-shards | Add database statistics by shards. | +| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'data-size', 'index-size', 'collections', 'views', 'documents', 'indexes', 'shard-storage-size', 'shard-data-size', 'shard-index-size', 'shard-collections', 'shard-views', 'shard-documents', 'shard-indexes'. | -| Option | Description | -|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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 failed. | -| --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'). | -| --warning-* --critical-* | Thresholds. Can be: 'total', 'insert', 'query', 'update', 'delete', 'getmore', 'command', 'insert-count', 'query-count', 'update-count', 'delete-count', 'getmore-count', 'command-count'. | +| Option | Description | +|:-------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --warning-* --critical-* | Thresholds. Can be: 'total', 'insert', 'query', 'update', 'delete', 'getmore', 'command', 'insert-count', 'query-count', 'update-count', 'delete-count', 'getmore-count', 'command-count'. | -| Option | Description | -|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --warning-status | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync_host\}. | -| --critical-status | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync_host\}. | -| --warning-member-status | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\}. | -| --critical-member-status | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\}. | -| --warning-* --critical-* | Thresholds. Can be: 'members-primary', 'members-secondary', 'members-arbiter', 'replication-lag'. | +| Option | Description | +|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --warning-status | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync\_host\}. | +| --critical-status | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync\_host\}. | +| --warning-member-status | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\}. | +| --critical-member-status | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\}. | +| --warning-* --critical-* | Thresholds. Can be: 'members-primary', 'members-secondary', 'members-arbiter', 'replication-lag'. | diff --git a/pp/integrations/plugin-packs/procedures/applications-databases-mongodb.md b/pp/integrations/plugin-packs/procedures/applications-databases-mongodb.md index 2638e46d5186..49c8ea1dfb48 100644 --- a/pp/integrations/plugin-packs/procedures/applications-databases-mongodb.md +++ b/pp/integrations/plugin-packs/procedures/applications-databases-mongodb.md @@ -5,6 +5,12 @@ title: MongoDB import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Connector dependencies + +The following monitoring connectors will be installed when you install the **MongoDB** connector through the +**Configuration > > Connectors > Monitoring Connectors** menu: +* [Base Pack](./base-generic.md) + ## Pack assets ### Templates @@ -18,13 +24,13 @@ The connector brings the following service templates (sorted by the host templat -| Service Alias | Service Template | Service Description | Discovery | -|:----------------------|:--------------------------------------------|:--------------------------------------------|:----------:| -| Collection-Statistics | App-DB-Mongodb-Collection-Statistics-custom | Check collection statistics, per database | X | -| Connection-Time | App-DB-Mongodb-Connection-Time-custom | Check connection time to instance | | -| Connections | App-DB-Mongodb-Connections-custom | Check the number of connections | | -| Database-Statistics | App-DB-Mongodb-Database-Statistics-custom | Check database statistics | X | -| Queries | App-DB-Mongodb-Queries-custom | Check queries per seconds | | +| Service Alias | Service Template | Service Description | Discovery | +|:----------------------|:--------------------------------------------|:--------------------------------------------|:---------:| +| Collection-Statistics | App-DB-Mongodb-Collection-Statistics-custom | Check collection statistics, per database | X | +| Connection-Time | App-DB-Mongodb-Connection-Time-custom | Check connection time to instance | | +| Connections | App-DB-Mongodb-Connections-custom | Check the number of connections | | +| Database-Statistics | App-DB-Mongodb-Database-Statistics-custom | Check database statistics | X | +| Queries | App-DB-Mongodb-Queries-custom | Check queries per second | | > The services listed above are created automatically when the **App-DB-Mongodb-custom** host template is used. @@ -56,88 +62,83 @@ and in the [following chapter](/docs/monitoring/discovery/services-discovery/#di ### Collected metrics & status -Here is the list of services for this connector, detailing all metrics linked to each service. +Here is the list of services for this connector, detailing all metrics and statuses linked to each service. -| Metric name | Unit | -|:-------------------------------------------------------------------|:------| -| *db_name~collection_name*#collection.size.storage.bytes | B | -| *db_name~collection_name*#collection.size.index.bytes | B | -| *db_name~collection_name*#collection.documents.count | | -| *db_name~collection_name*#collection.indexes.count | | -| *db_name~collection_name~shard_name*#collection.size.storage.bytes | B | -| *db_name~collection_name~shard_name*#collection.size.index.bytes | B | -| *db_name~collection_name~shard_name*#collection.documents.count | | -| *db_name~collection_name~shard_name*##collection.indexes.count | | +| Name | Unit | +|:--------------------------------------------------------|:------| +| *databases*~*collections*#collection.size.storage.bytes | B | +| *databases*~*collections*#collection.size.index.bytes | B | +| *databases*~*collections*#collection.documents.count | count | +| *databases*~*collections*#collection.indexes.count | count | +| *databases*~*shards*#collection.size.storage.bytes | B | +| *databases*~*shards*#collection.size.index.bytes | B | +| *databases*~*shards*#collection.documents.count | count | +| *databases*~*shards*#collection.indexes.count | count | -| Metric name | Unit | +| Name | Unit | |:-----------------------------|:------| | connection.time.milliseconds | ms | -| Metric name | Unit | -|:------------------------------|:------| -| connections.active.count | | -| connections.current.count | | -| connections.usage.percentage | % | -| connections.created.persecond | | +| Name | Unit | +|:-----------------------------|:------| +| connections.active.count | count | +| connections.current.count | count | +| connections.usage.percentage | % | +| total-created | N/A | -| Metric name | Unit | -|:-------------------------------------------------|:------| -| *db_name*#database.size.storage.bytes | B | -| *db_name*#database.size.data.bytes | B | -| *db_name*#database.size.index.bytes | B | -| *db_name*#database.collections.count | | -| *db_name*#database.views.count | | -| *db_name*#database.documents.count | | -| *db_name*#database.indexes.count | | -| *db_name~shard_name*#database.size.storage.bytes | B | -| *db_name~shard_name*#database.size.data.bytes | B | -| *db_name~shard_name*#database.size.index.bytes | B | -| *db_name~shard_name*#database.collections.count | | -| *db_name~shard_name*#database.views.count | | -| *db_name~shard_name*#database.documents.count | | -| *db_name~shard_name*#database.indexes.count | | +| Name | Unit | +|:----------------------------------------|:------| +| *databases*#database.size.storage.bytes | B | +| *databases*#database.size.data.bytes | B | +| *databases*#database.size.index.bytes | B | +| *databases*#database.collections.count | count | +| *databases*#database.views.count | count | +| *databases*#database.documents.count | count | +| *databases*#database.indexes.count | count | +| *shards*#database.size.storage.bytes | B | +| *shards*#database.size.data.bytes | B | +| *shards*#database.size.index.bytes | B | +| *shards*#database.collections.count | count | +| *shards*#database.views.count | count | +| *shards*#database.documents.count | count | +| *shards*#database.indexes.count | count | -| Metric name | Unit | +| Name | Unit | |:--------------------------|:------| -| queries.total.persecond | | -| queries.insert.persecond | | -| queries.insert.count | | -| queries.query.persecond | | -| queries.query.count | | -| queries.update.persecond | | -| queries.update.count | | -| queries.delete.persecond | | -| queries.delete.count | | -| queries.getmore.persecond | | -| queries.getmore.count | | -| queries.command.persecond | | -| queries.command.count | | +| queries.total.persecond | /s | +| queries.insert.persecond | /s | +| queries.query.persecond | /s | +| queries.update.persecond | /s | +| queries.delete.persecond | /s | +| queries.getmore.persecond | /s | +| queries.command.persecond | /s | -| Metric name | Unit | -|:--------------------------------------|:------| -| member status | | -| members.primary.count | | -| members.secondary.count | | -| members.arbiter.count | | -| *member_name*#replication.lag.seconds | s | +| Name | Unit | +|:----------------------------------|:------| +| status | N/A | +| members.primary.count | count | +| members.secondary.count | count | +| members.arbiter.count | count | +| member-status | N/A | +| *members*#replication.lag.seconds | s | @@ -159,9 +160,6 @@ Listing of user privileges needed by service: ### 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). - - 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 > Connectors > Monitoring Connectors** menu. @@ -251,17 +249,17 @@ yum install centreon-plugin-Applications-Databases-Mongodb ### Using a host template provided by the connector 1. Log into Centreon and add a new host through **Configuration > Hosts**. -2. Fill the **Name**, **Alias** & **IP Address/DNS** fields according to your ressource settings. +2. Fill in the **Name**, **Alias** & **IP Address/DNS** fields according to your resource's settings. 3. Apply the **App-DB-Mongodb-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 | -|:----------------|:------------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| MONGODBUSERNAME | MongoDB username | | X | -| MONGODBPASSWORD | MongoDB password | | X | -| MONGODBPROTOCOL | Protocol used (Default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | mongodb | | -| MONGODBPORT | Port used by MongoDB | 27017 | | -| EXTRAOPTIONS | Any extra option you may want to add to every command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:----------------|:-----------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| MONGODBUSERNAME | MongoDB username | | | +| MONGODBPASSWORD | MongoDB password | | | +| MONGODBPROTOCOL | Protocol used DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | mongodb | | +| MONGODBPORT | Port used by MongoDB | 27017 | | +| 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. @@ -273,106 +271,106 @@ yum install centreon-plugin-Applications-Databases-Mongodb -| Macro | Description | Default value | Mandatory | -|:------------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERDATABASE | Filter databases by name (Can use regexp) | | | -| FILTERCOUNTERS | | | | -| WARNINGCOLLECTIONDOCUMENTS | Thresholds | | | -| CRITICALCOLLECTIONDOCUMENTS | Thresholds | | | -| WARNINGCOLLECTIONINDEXES | Thresholds | | | -| CRITICALCOLLECTIONINDEXES | Thresholds | | | -| WARNINGCOLLECTIONSIZEINDEX | Thresholds | | | -| CRITICALCOLLECTIONSIZEINDEX | Thresholds | | | -| WARNINGCOLLECTIONSIZESTORAGE | Thresholds | | | -| CRITICALCOLLECTIONSIZESTORAGE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:--------------|:-----------:| +| FILTERDATABASE | Filter databases by name (can use regexp) | | | +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGCOLLECTIONDOCUMENTS | Threshold | | | +| CRITICALCOLLECTIONDOCUMENTS | Threshold | | | +| WARNINGCOLLECTIONINDEXES | Threshold | | | +| CRITICALCOLLECTIONINDEXES | Threshold | | | +| WARNINGCOLLECTIONSIZEINDEX | Threshold | | | +| CRITICALCOLLECTIONSIZEINDEX | Threshold | | | +| WARNINGCOLLECTIONSIZESTORAGE | Threshold | | | +| CRITICALCOLLECTIONSIZESTORAGE | 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). | | | -| Macro | Description | Default value | Mandatory | -|:-----------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| WARNINGCONNECTIONTIME | Thresholds | | | -| CRITICALCONNECTIONTIME | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| WARNINGCONNECTIONTIME | Threshold | | | +| CRITICALCONNECTIONTIME | 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). | | | -| Macro | Description | Default value | Mandatory | -|:-----------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERCOUNTERS | | | | -| WARNINGACTIVE | Thresholds | | | -| CRITICALACTIVE | Thresholds | | | -| WARNINGCONNECTIONSPERSECOND | Thresholds | | | -| CRITICALCONNECTIONSPERSECOND | Thresholds | | | -| WARNINGCURRENT | Thresholds | | | -| CRITICALCURRENT | Thresholds | | | -| WARNINGUSAGE | Thresholds | | | -| CRITICALUSAGE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:-----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGACTIVE | Threshold | | | +| CRITICALACTIVE | Threshold | | | +| WARNINGCONNECTIONSPERSECOND | Threshold | | | +| CRITICALCONNECTIONSPERSECOND | Threshold | | | +| WARNINGCURRENT | Threshold | | | +| CRITICALCURRENT | Threshold | | | +| WARNINGUSAGE | Threshold | | | +| CRITICALUSAGE | 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). | | | -| Macro | Description | Default value | Mandatory | -|:----------------------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| FILTERDATABASE | Filter databases by name (Can use regexp) | | | -| FILTERCOUNTERS | | | | -| WARNINGDATABASECOLLECTIONS | Thresholds | | | -| CRITICALDATABASECOLLECTIONS | Thresholds | | | -| WARNINGDATABASEDOCUMENTS | Thresholds | | | -| CRITICALDATABASEDOCUMENTS | Thresholds | | | -| WARNINGDATABASEINDEXES | Thresholds | | | -| CRITICALDATABASEINDEXES | Thresholds | | | -| WARNINGDATABASESIZEDATA | Thresholds | | | -| CRITICALDATABASESIZEDATA | Thresholds | | | -| WARNINGDATABASESIZEINDEX | Thresholds | | | -| CRITICALDATABASESIZEINDEX | Thresholds | | | -| WARNINGDATABASESIZESTORAGE | Thresholds | | | -| CRITICALDATABASESIZESTORAGE | Thresholds | | | -| WARNINGDATABASEVIEWS | Thresholds | | | -| CRITICALDATABASEVIEWS | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| FILTERDATABASE | Filter databases by name (can use regexp) | | | +| FILTERCOUNTERS | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | | | +| WARNINGDATABASECOLLECTIONS | Threshold | | | +| CRITICALDATABASECOLLECTIONS | Threshold | | | +| WARNINGDATABASEDOCUMENTS | Threshold | | | +| CRITICALDATABASEDOCUMENTS | Threshold | | | +| WARNINGDATABASEINDEXES | Threshold | | | +| CRITICALDATABASEINDEXES | Threshold | | | +| WARNINGDATABASESIZEDATA | Threshold | | | +| CRITICALDATABASESIZEDATA | Threshold | | | +| WARNINGDATABASESIZEINDEX | Threshold | | | +| CRITICALDATABASESIZEINDEX | Threshold | | | +| WARNINGDATABASESIZESTORAGE | Threshold | | | +| CRITICALDATABASESIZESTORAGE | Threshold | | | +| WARNINGDATABASEVIEWS | Threshold | | | +| CRITICALDATABASEVIEWS | 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). | | | -| Macro | Description | Default value | Mandatory | -|:----------------|:----------------------------------------------------------------------------------------------------|:------------------|:-----------:| -| WARNINGCOMMAND | Thresholds | | | -| CRITICALCOMMAND | Thresholds | | | -| WARNINGDELETE | Thresholds | | | -| CRITICALDELETE | Thresholds | | | -| WARNINGGETMORE | Thresholds | | | -| CRITICALGETMORE | Thresholds | | | -| WARNINGINSERT | Thresholds | | | -| CRITICALINSERT | Thresholds | | | -| WARNINGQUERY | Thresholds | | | -| CRITICALQUERY | Thresholds | | | -| WARNINGTOTAL | Thresholds | | | -| CRITICALTOTAL | Thresholds | | | -| WARNINGUPDATE | Thresholds | | | -| CRITICALUPDATE | Thresholds | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:----------------|:---------------------------------------------------------------------------------------------------------------------------------------|:------------------|:-----------:| +| WARNINGCOMMAND | Threshold | | | +| CRITICALCOMMAND | Threshold | | | +| WARNINGDELETE | Threshold | | | +| CRITICALDELETE | Threshold | | | +| WARNINGGETMORE | Threshold | | | +| CRITICALGETMORE | Threshold | | | +| WARNINGINSERT | Threshold | | | +| CRITICALINSERT | Threshold | | | +| WARNINGQUERY | Threshold | | | +| CRITICALQUERY | Threshold | | | +| WARNINGTOTAL | Threshold | | | +| CRITICALTOTAL | Threshold | | | +| WARNINGUPDATE | Threshold | | | +| CRITICALUPDATE | 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). | | | -| Macro | Description | Default value | Mandatory | -|:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------|:-----------:| -| WARNINGMEMBERSTATUS | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\} | %\{state\} !~ /PRIMARY\|SECONDARY/ | | -| CRITICALMEMBERSTATUS | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\} | %\{health\} !~ /up/ | | -| WARNINGREPLICATIONLAG | Thresholds | | | -| CRITICALREPLICATIONLAG | Thresholds | | | -| WARNINGSTATUS | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync_host\} | | | -| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync_host\} | | | -| EXTRAOPTIONS | Any extra option you may want to add to the command (E.g. a --verbose flag). All options are listed [here](#available-options) | | | +| Macro | Description | Default value | Mandatory | +|:-----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------:| +| WARNINGMEMBERSTATUS | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\} | %\{state\} !~ /PRIMARY\|SECONDARY/ | | +| CRITICALMEMBERSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\} | %\{health\} !~ /up/ | | +| WARNINGREPLICATIONLAG | Threshold | | | +| CRITICALREPLICATIONLAG | Threshold | | | +| WARNINGSTATUS | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync\_host\} | | | +| CRITICALSTATUS | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync\_host\} | | | +| EXTRAOPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). All options are listed [here](#available-options). | | | -3. [Deploy the configuration](/docs/monitoring/monitoring-servers/deploying-a-configuration). The service appears in the list of services, and on page **Resources Status**. The command that is sent by the connector is displayed in the details panel of the service: it shows the values of the macros. +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 check in the CLI that the configuration is OK and what are the main options for? @@ -385,11 +383,16 @@ is able to monitor a resource using a command like this one (replace the sample --plugin=database::mongodb::plugin \ --mode=replication-status \ --hostname=10.0.0.1 \ - --username='myuser' \ - --password='******' \ + --username='' \ + --password='' \ --port='27017' \ --protocol='mongodb' \ - --verbose + --warning-status='' \ + --critical-status='' \ + --warning-member-status='%\{state\} !~ /PRIMARY|SECONDARY/' \ + --critical-member-status='%\{health\} !~ /up/' \ + --warning-instance-replication-lag-seconds='' \ + --critical-instance-replication-lag-seconds='' ``` The expected command output is shown below: @@ -440,47 +443,53 @@ The plugin brings the following modes: All generic options are listed here: -| Option | Description | -|:-------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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. Eg: 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). Eg: 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). Eg: 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\],\[m ax\]\] Common examples: 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() | -| --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\[,\[ne wuom\],\[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: 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(traf fic\_(in\|out)\_$1)' | -| --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). Eg: 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. Eg: 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. Eg: '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'. MongoDB driver | -| --hostname | MongoDB server hostname. | -| --port | Port used by MongoDB. | -| --protocol | Protocol used (Default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | -| --username | MongoDB username. | -| --password | MongoDB password. | -| --timeout | Set timeout in seconds (Default: 10). | -| --ssl-opt | Set SSL Options (--ssl-opt="SSL\_version =\> 'TLSv1'" --ssl-opt="SSL\_verify\_mode =\> SSL\_VERIFY\_NONE"). | -| --no-ssl | Don't use ssl connection. | +| Option | Description | +|:-------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --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: =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 | +| --change-perfdata | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[\\],\[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 | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target\[,\[\\],\[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,\,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: =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-short-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-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'. =head1 DESCRIPTION B\. =cut | +| --filter-counters | Only display some counters (regexp can be used). Example to check SSL connections only : --filter-counters='^xxxx\|yyyy$' | +| --hostname | MongoDB server hostname. | +| --port | Port used by MongoDB. | +| --protocol | Protocol used (default: mongodb) DNS Seedlist Connection Format can be specified, i.e. 'mongodb+srv' | +| --username | MongoDB username. | +| --password | MongoDB password. | +| --timeout | Set timeout in seconds (default: 10). | +| --ssl-opt | Set SSL Options (--ssl-opt="SSL\_version =\> 'TLSv1'" --ssl-opt="SSL\_verify\_mode =\> SSL\_VERIFY\_NONE"). | +| --no-ssl | Don't use ssl connection. | #### Modes options @@ -489,79 +498,55 @@ All available options for each service template are listed below: -| Option | Description | -|:-------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------| -| --filter-database | Filter databases by name (Can use regexp). | -| --filter-shard | Filter shards by name (Can use regexp). | -| --add-shards | Add collection statistics by shards. | -| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'index-size', 'documents', 'indexes', 'shard-storage-size', 'shard-index-size', 'shard-documents', 'shard-indexes'. | +| Option | Description | +|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-database | Filter databases by name (can use regexp). | +| --filter-shard | Filter shards by name (can use regexp). | +| --add-shards | Add collection statistics by shards. | +| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'index-size', 'documents', 'indexes', 'shard-storage-size', 'shard-index-size', 'shard-documents', 'shard-indexes'. | -| Option | Description | -|:---------------------------|:---------------------------------------| -| --warning-connection-time | Warning threshold in milliseconds. | -| --critical-connection-time | Critical threshold in milliseconds. | +| Option | Description | +|:---------------------------|:-----------------------------------------| +| --warning-connection-time | Warning threshold in milliseconds. | +| --critical-connection-time | Critical threshold in milliseconds. | -| Option | Description | -|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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 failed. | -| --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'). | -| --warning-* --critical-* | Thresholds. Can be: 'active', 'current', 'usage', 'total-created'. | +| Option | Description | +|:-------------------------|:------------------------------------------------------------------------| +| --warning-* --critical-* | Thresholds. Can be: 'active', 'current', 'usage', 'total-created'. | -| Option | Description | -|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --filter-database | Filter databases by name (Can use regexp). | -| --filter-shard | Filter shards by name (Can use regexp). | -| --add-shards | Add database statistics by shards. | -| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'data-size', 'index-size', 'collections', 'views', 'documents', 'indexes', 'shard-storage-size', 'shard-data-size', 'shard-index-size', 'shard-collections', 'shard-views', 'shard-documents', 'shard-indexes'. | +| Option | Description | +|:-------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --filter-database | Filter databases by name (can use regexp). | +| --filter-shard | Filter shards by name (can use regexp). | +| --add-shards | Add database statistics by shards. | +| --warning-* --critical-* | Thresholds. Can be: 'storage-size', 'data-size', 'index-size', 'collections', 'views', 'documents', 'indexes', 'shard-storage-size', 'shard-data-size', 'shard-index-size', 'shard-collections', 'shard-views', 'shard-documents', 'shard-indexes'. | -| Option | Description | -|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --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 failed. | -| --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'). | -| --warning-* --critical-* | Thresholds. Can be: 'total', 'insert', 'query', 'update', 'delete', 'getmore', 'command', 'insert-count', 'query-count', 'update-count', 'delete-count', 'getmore-count', 'command-count'. | +| Option | Description | +|:-------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --warning-* --critical-* | Thresholds. Can be: 'total', 'insert', 'query', 'update', 'delete', 'getmore', 'command', 'insert-count', 'query-count', 'update-count', 'delete-count', 'getmore-count', 'command-count'. | -| Option | Description | -|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --warning-status | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync_host\}. | -| --critical-status | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync_host\}. | -| --warning-member-status | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\}. | -| --critical-member-status | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave_delay\}, %\{priority\}. | -| --warning-* --critical-* | Thresholds. Can be: 'members-primary', 'members-secondary', 'members-arbiter', 'replication-lag'. | +| Option | Description | +|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| --warning-status | Define the conditions to match for the status to be WARNING. You can use the following variables: %\{state\}, %\{sync\_host\}. | +| --critical-status | Define the conditions to match for the status to be CRITICAL. You can use the following variables: %\{state\}, %\{sync\_host\}. | +| --warning-member-status | Define the conditions to match for the status to be WARNING (default: '%\{state\} !~ /PRIMARY\|SECONDARY/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\}. | +| --critical-member-status | Define the conditions to match for the status to be CRITICAL (default: '%\{health\} !~ /up/'). You can use the following variables: %\{name\}, %\{state\}, %\{health\}, %\{slave\_delay\}, %\{priority\}. | +| --warning-* --critical-* | Thresholds. Can be: 'members-primary', 'members-secondary', 'members-arbiter', 'replication-lag'. |