Splunk
Dépendances du Connecteur de supervision
Les connecteurs de supervision suivants sont automatiquement installés lors de l'installation du connecteur Splunk depuis la page Configuration > Gestionnaire de connecteurs de supervision :
Contenu du pack
Modèles
Le connecteur de supervision Splunk apporte un modèle d'hôte :
- App-Monitoring-Splunk-Api-custom
Le connecteur apporte les modèles de service suivants (classés selon le modèle d'hôte auquel ils sont rattachés) :
- App-Monitoring-Splunk-Api-custom
- Non rattachés à un modèle d'hôte
| Alias | Modèle de service | Description |
|---|---|---|
| Index-Update | App-Monitoring-Splunk-Index-Update-Api-custom | Contrôle l'heure à laquelle un index a été mis à jour pour la dernière fois |
| Splunkd-Health | App-Monitoring-Splunk-Splunkd-Health-Api-custom | Contrôle l'état général de splunkd. Le statut de splunkd est basé sur l'état de toutes les features le composant |
Les services listés ci-dessus sont créés automatiquement lorsque le modèle d'hôte App-Monitoring-Splunk-Api-custom est utilisé.
| Alias | Modèle de service | Description |
|---|---|---|
| Query-Matches-Number | App-Monitoring-Splunk-Query-Api-custom | Contrôle le nombre de résultats pour une requête donnée. La requête doit commencer par "search ". Par exemple : 'search host="prod-server" "ERROR" earliest=-150000min' |
| Query-Numeric-Value | App-Monitoring-Splunk-Numeric-Value-Api-custom | Contrôle permettant de récupérer des valeurs numériques à partir d'une requête |
| Query-String-Value | App-Monitoring-Splunk-String-Value-Api-custom | Contrôle permettant de récupérer des valeurs alphanumériques à partir d'une requête |
Les services listés ci-dessus ne sont pas créés automatiquement lorsqu'un modèle d'hôte est appliqué. Pour les utiliser, créez un service manuellement et appliquez le modèle de service souhaité.
Métriques & statuts collectés
Voici le tableau des services pour ce connecteur, détaillant les métriques et statuts rattachés à chaque service.
- Index-Update
- Query-Matches-Number
- Query-Numeric-Value
- Query-String-Value
- Splunkd-Health
| Nom | Unité |
|---|---|
| index#splunk.index.last.updated.seconds | s |
| Nom | Unité |
|---|---|
| splunk.query.matches.count | count |
| Nom | Unité |
|---|---|
| splunk.event.count | count |
Les autres métriques obtenues dépendent de la requête.
| Nom | Unité |
|---|---|
| splunk.event.count | count |
Les autres métriques obtenues dépendent de la requête.
| Status Name |
|---|
| file-monitor-input |
| index-processor |
| resource-usage |
| search-scheduler |
| workload-management |
Prérequis
Un utilisateur doit être créé/configuré afin d'accéder aux terminaisons d'API suivantes:
- /services/data/indexes
- /services/server/health/splunkd/details
- /services/search/jobs/*
Installer le connecteur de supervision
Pack
La procédure d'installation des connecteurs de supervision diffère légèrement suivant que votre licence est offline ou online.
- 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 sur le serveur central via la commande correspondant au gestionnaire de paquets associé à sa distribution :
- Alma / RHEL / Oracle Linux 8
- Alma / RHEL / Oracle Linux 9
- Debian 11 & 12
- CentOS 7
dnf install centreon-pack-applications-monitoring-splunk-api
dnf install centreon-pack-applications-monitoring-splunk-api
apt install centreon-pack-applications-monitoring-splunk-api
yum install centreon-pack-applications-monitoring-splunk-api
- Quel que soit le type de la licence (online ou offline), installez le connecteur Splunk depuis l'interface web et le menu Configuration > Connecteurs > Connecteurs de supervision.
Plugin
À partir de Centreon 22.04, il est possible de demander le déploiement automatique du plugin lors de l'utilisation d'un connecteur. Si cette fonctionnalité est activée, et que vous ne souhaitez pas découvrir des éléments pour la première fois, alors cette étape n'est pas requise.
Plus d'informations dans la section Installer le plugin.
Utilisez les commandes ci-dessous en fonction du gestionnaire de paquets de votre système d'exploitation :
- Alma / RHEL / Oracle Linux 8
- Alma / RHEL / Oracle Linux 9
- Debian 11 & 12
- CentOS 7
dnf install centreon-plugin-Applications-Monitoring-Splunk-Api
dnf install centreon-plugin-Applications-Monitoring-Splunk-Api
apt install centreon-plugin-applications-monitoring-splunk-api
yum install centreon-plugin-Applications-Monitoring-Splunk-Api
Utiliser le connecteur de supervision
Utiliser un modèle d'hôte issu du connecteur
- Ajoutez un hôte à Centreon depuis la page Configuration > Hôtes.
- Complétez les champs Nom, Alias & IP Address/DNS correspondant à votre ressource.
- Appliquez le modèle d'hôte App-Monitoring-Splunk-Api-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.
- Renseignez les macros désirées. Attention, certaines macros sont obligatoires.
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| SPLUNKAPIUSERNAME | Specify api username | X | |
| SPLUNKAPIPASSWORD | Specify api password | X | |
| SPLUNKAPIPROTOCOL | Specify http if needed (default: 'https') | https | |
| SPLUNKAPIPORT | API port (default: 8089) | 8089 | |
| SPLUNKAPIHOST | Splunk server address | X | |
| SPLUNKAPIEXTRAOPTIONS | Any extra option you may want to add to every command (a --verbose flag for example). Toutes les options sont listées ici. |
- Déployez la 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.
Utiliser un modèle de service issu du connecteur
- Si vous avez utilisé un modèle d'hôte et coché la case Créer aussi les services liés aux modèles, les services associés au modèle ont été créés automatiquement, avec les modèles de services correspondants. Sinon, créez les services désirés manuellement et appliquez-leur un modèle de service.
- Renseignez les macros désirées (par exemple, ajustez les seuils d'alerte). Les macros indiquées ci-dessous comme requises (Obligatoire) doivent être renseignées.
- Index-Update
- Query-Matches-Number
- Query-Numeric-Value
- Query-String-Value
- Splunkd-Health
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| INDEXNAME | Specify index name to get last updates. If not specified, all indexes are checked by default | .* | |
| WARNINGINDEXLASTUPDATESECONDS | Warning threshold in seconds for last update. Example: --warning-index-last-update-seconds=15000 | ||
| CRITICALINDEXLASTUPDATESECONDS | Critical threshold in seconds for last update. Example: --critical-index-last-update-seconds=25000 |
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| QUERY | Specify a query to be made and check matching number. Query has to start with "search ". Example: --query='search host="prod-server" "ERROR" earliest=-150000min' | X | |
| WARNINGQUERYMATCHINGNUMBER | Warning threshold for query matches. Example: --warning-query-matches=5 | ||
| CRITICALQUERYMATCHINGNUMBER | Critical threshold for query matches. Example: --critical-query-matches=15 |
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| SEARCHMODE | Specify the search mode (default: 'auto'). Can be: 'auto', 'fast', 'smart', 'verbose'. The 'auto' value lets Splunk use its default mode. Check https://help.splunk.com/en/splunk-cloud-platform/search/search-manual/10.0.2503/using-the-search-app/search-modes for more details | auto | |
| EVENTLABEL | Label to use to prefix perfdata output (default: 'event') | event | |
| INCLUDENONNUMERICFIELD | By default all non numeric value are ignored. This option allows to include them | 0 | |
| QUERY | Specify a query to be sent to Splunk. If the query starts with '@', it is considered as a file name to read the query from. Query has to start with "search" or "|". Example: --query='index=main | table skippedRatio | where skippedRatio > 0.2' | X | |
| INCLUDEINTERNALFIELD | By default fields starting with '_' are considered as internal and ignored. This option allows to include them. Example: --include-internal-field=_raw This option can be used multiple times and multiple values can be passed as a comma separated list | ||
| INCLUDE | Define the Splunk fields to be managed by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is empty (default) all fields are managed by the plugin, otherwise, only matching fields are managed. Only managed fields can be displayed and used for checks | ||
| EXCLUDE | Define the Splunk fields to be ignored by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is not empty, all matching fields are ignored by the plugin. Only managed fields can be displayed and used for checks | ||
| DISPLAY | Define the Splunk fields to be displayed on perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is empty (default), all fields are displayed; otherwise, only matching fields are displayed. Fields are always displayed in the long output in verbose mode | ||
| HIDE | Define the Splunk fields to hide from perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is not empty, all matching fields are hidden. Fields are always displayed in the long output in verbose mode | ||
| EVENTFIELD | Define the field value used to prefix the perfdata output | ||
| OKLABEL | Define the label to use for events that trigger the OK threshold | ||
| PERFDATAUNIT | Perfdata unit in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the unit are separated by an equals sign. If the [field] name is not set, the [unit] applies to all fields that do not have a defined unit. Syntax: '--perfdata-unit=[field]=[unit]' For example to set a unit '%' for the field 'skippedRatio': '-perfdata-unit=skippedRatio=%' Or to set a unit for all fields without a specific unit: '--perfdata-unit=%' | ||
| PERFDATANAME | Perfdata name in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the name are separated by an equals sign. If the [field] name is not set, the [name] applies to all fields that do not have a defined name. Syntax: '--perfdata-name=[field]=[name]' For example to set name 'test' for the field 'skippedRatio': '--perfdata-name=skippedRatio=test' Or to set a name for all fields without a specific name: '--perfdata-name=test' | ||
| PERFDATAMIN | Minimum value to add in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the minimum value are separated by an equals sign. If the [field] name is not set, the [minimum value] applies to all fields that do not have a defined minimum value. Syntax: '--perfdata-min=[field]=[minimum value]' For example to set minimum value '1' for the field 'skippedRatio': '--perfdata-min=skippedRatio=1' Or to set a minimum value for all fields without a specific name: '--perfdata-min=1' | ||
| PERFDATAMAX | Maximum value to add in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the maximum value are separated by an equals sign. If the [field] name is not set, the [maximum value] applies to all fields that do not have a defined maximum value. Syntax: '--perfdata-max=[field]=[maximum value]' For example to set maximum value '100' for the field 'skippedRatio': '--perfdata-max=skippedRatio=100' Or to set a maximum value for all fields without a specific name: '--perfdata-max=100' | ||
| WARNINGCOUNT | Warning threshold for query matches. Example: --warning-count=5 | ||
| CRITICALCOUNT | Critical threshold for query matches. Example: --critical-count=15 | ||
| WARNINGLABEL | Define the label to use for events that trigger the WARNING threshold | trigger WARNING threshold | |
| CRITICALLABEL | Define the label to use for events that trigger the CRITICAL threshold | trigger CRITICAL threshold | |
| WARNINGVALUE | Warning threshold for a specific field value. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the threshold are separated by an equals sign. If the [field] name is not set, the [threshold] applies to all fields that do not have a defined threshold. Syntax: '--warning-value=[field]=[threshold]' For example to set a threshold of ':1' for the field 'skippedRatio': '--warning-value=skippedRatio=:1' Or to set a threshold for all fields without a specific threshold: '--warning-value=:1' You cannot define multiple thresholds for the same field | ||
| CRITICALVALUE | Critical threshold for a specific field value. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the threshold are separated by an equals sign. If the [field] name is not set, the [threshold] applies to all fields that do not have a defined threshold. Syntax: '--critical-value=[field]=[threshold]' For example to set a threshold of ':1' for the field 'skippedRatio': '--critical-value=skippedRatio=:1' Or to set a threshold for all fields without a specific threshold: '--critical-value=:1' You cannot define multiple thresholds for the same field | ||
| EXTRAOPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). Toutes les options sont listées ici. |
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| SEARCHMODE | Specify the search mode (default: 'auto'). Can be: 'auto', 'fast', 'smart', 'verbose'. The 'auto' value lets Splunk use its default mode. Check https://help.splunk.com/en/splunk-cloud-platform/search/search-manual/10.0.2503/using-the-search-app/search-modes for more details | auto | |
| EVENTLABEL | Label to use to prefix perfdata output (default: 'event') | event | |
| QUERY | Specify a query to be sent to Splunk. If the query starts with '@', it is considered as a file name to read the query from. Query has to start with "search" or "|". Example: --query='index=main | table skippedRatio | where skippedRatio > 0.2' | X | |
| INCLUDEINTERNALFIELD | By default fields starting with '_' are considered as internal and ignored. This option allows to include them. Example: --include-internal-field=_raw This option can be used multiple times and multiple values can be passed as a comma separated list | ||
| INCLUDE | Define the Splunk fields to be managed by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is empty (default) all fields are managed by the plugin, otherwise, only matching fields are managed. Only managed fields can be displayed and used for checks | ||
| EXCLUDE | Define the Splunk fields to be ignored by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is not empty, all matching fields are ignored by the plugin. Only managed fields can be displayed and used for checks | ||
| DISPLAY | Define the Splunk fields to be displayed on perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is empty (default), all fields are displayed; otherwise, only matching fields are displayed. | ||
| HIDE | Define the Splunk fields to hide from perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is not empty, all matching fields are hidden. | ||
| EVENTFIELD | Define the field value used to prefix the perfdata output | ||
| OKLABEL | Define the label to use for events that trigger the OK threshold (default: '') | ||
| WARNINGCOUNT | Warning threshold for query matches. Example: --warning-count=5 | ||
| CRITICALCOUNT | Critical threshold for query matches. Example: --critical-count=15 | ||
| WARNINGLABEL | Define the label to use for events that trigger the WARNING status | trigger WARNING status | |
| CRITICALLABEL | Define the label to use for events that trigger the CRITICAL status | trigger CRITICAL status | |
| WARNINGVALUE | Define the conditions to match for the status to be WARNING. Field names can be used as variables, and complex expressions are supported. Example: --warning-value='%{sourcetype} =~ /orchestrator/' | ||
| CRITICALVALUE | Define the conditions to match for the status to be WARNING. Field names can be used as variables, and complex expressions are supported. Example: --warning-value='%{sourcetype} =~ /orchestrator/' | ||
| EXTRAOPTIONS | Any extra option you may want to add to the command (a --verbose flag for example). Toutes les options sont listées ici. |
| Macro | Description | Valeur par défaut | Obligatoire |
|---|---|---|---|
| WARNINGFILEMONITORINPUTSTATUS | Warning thresholds for features status. (default: '%{status} =~ /yellow/') | ||
| CRITICALFILEMONITORINPUTSTATUS | Critical thresholds for features status. (default: '%{status} =~ /red/') | ||
| WARNINGINDEXPROCESSORSTATUS | Warning thresholds for features status. (default: '%{status} =~ /yellow/') | ||
| CRITICALINDEXPROCESSORSTATUS | Critical thresholds for features status. (default: '%{status} =~ /red/') | ||
| WARNINGRESOURCEUSAGESTATUS | Warning thresholds for features status. (default: '%{status} =~ /yellow/') | ||
| CRITICALRESOURCEUSAGESTATUS | Critical thresholds for features status. (default: '%{status} =~ /red/') | ||
| WARNINGSEARCHSCHEDULERSTATUS | Warning thresholds for features status. (default: '%{status} =~ /yellow/') | ||
| CRITICALSEARCHSCHEDULERSTATUS | Critical thresholds for features status. (default: '%{status} =~ /red/') | ||
| WARNINGWORKLOADMANAGEMENTSTATUS | Warning thresholds for features status. (default: '%{status} =~ /yellow/') | ||
| CRITICALWORKLOADMANAGEMENTSTATUS | Critical thresholds for features status. (default: '%{status} =~ /red/') |
- Déployez la configuration. Le service apparaît dans la liste des services supervisés, et dans la page Statut des ressources. La commande envoyée par le connecteur est indiquée dans le panneau de détails du service : celle-ci montre les valeurs des macros.
Comment puis-je tester le plugin et que signifient les options des commandes ?
Une fois le plugin installé, vous pouvez tester celui-ci directement en ligne
de commande depuis votre collecteur Centreon en vous connectant avec
l'utilisateur centreon-engine (su - centreon-engine). Vous pouvez tester
que le connecteur arrive bien à superviser une ressource en utilisant une commande
telle que celle-ci (remplacez les valeurs d'exemple par les vôtres) :
/usr/lib/centreon/plugins/centreon_monitoring_splunk_api.pl \
--plugin=apps::monitoring::splunk::plugin \
--mode=query \
--hostname='' \
--port='8089' \
--proto='https' \
--api-username='' \
--api-password='' \
--query='' \
--warning-query-matches='' \
--critical-query-matches=''
La commande devrait retourner un message de sortie similaire à :
OK: query matches: 14 | 'splunk.query.matches.count'=14;;;0;
Diagnostic des erreurs communes
Rendez-vous sur la documentation dédiée des plugins basés sur HTTP/API.
Modes disponibles
Dans la plupart des cas, un mode correspond à un modèle de service. Le mode est renseigné dans la commande d'exécution du connecteur. Dans l'interface de Centreon, il n'est pas nécessaire de les spécifier explicitement, leur utilisation est implicite dès lors que vous utilisez un modèle de service. En revanche, vous devrez spécifier le mode correspondant à ce modèle si vous voulez tester la commande d'exécution du connecteur dans votre terminal.
Tous les modes disponibles peuvent être affichés en ajoutant le paramètre
--list-mode à la commande :
/usr/lib/centreon/plugins/centreon_monitoring_splunk_api.pl \
--plugin=apps::monitoring::splunk::plugin \
--list-mode
Le plugin apporte les modes suivants :
| Mode | Modèle de service associé |
|---|---|
| index-update [code] | App-Monitoring-Splunk-Index-Update-Api-custom |
| query [code] | App-Monitoring-Splunk-Query-Api-custom |
| splunkd-health [code] | App-Monitoring-Splunk-Splunkd-Health-Api-custom |
| string-value [code] | App-Monitoring-Splunk-String-Value-Api-custom |
| numeric-value [code] | App-Monitoring-Splunk-Numeric-Value-Api-custom |
Options disponibles
Options génériques
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. Example: adding --filter-perfdata='avg' will remove all metrics that do not contain 'avg' from performance data. |
| --filter-perfdata-adv | Filter perfdata based on a "if" condition using the following variables: label, value, unit, warning, critical, min, max. Variables must be written either %{variable} or %(variable). Example: adding --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")' will remove all metrics whose value equals 0 and that don't have a maximum value. |
| --explode-perfdata-max | Create a new metric for each metric that comes with a maximum limit. The new metric will be named identically with a '_max' suffix). Example: it will split 'used_prct'=26.93%;0:80;0:90;0;100 into 'used_prct'=26.93%;0:80;0:90;0;100 'used_prct_max'=100%;;;; |
| --change-perfdata --extend-perfdata | Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target[,[newuom],[min],[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 |
| --change-exit | Replace an exit code with one of your choice. Example: adding --change-exit=unknown=critical will result in a CRITICAL state instead of an UNKNOWN state. |
| --range-perfdata | Rewrite the ranges displayed in the perfdata. Accepted values: 0: nothing is changed. 1: if the lower value of the range is equal to 0, it is removed. 2: remove the thresholds from the perfdata. |
| --filter-uom | Mask the units when they don't match the given regular expression. |
| --opt-exit | Replace the exit code in case of an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc). Default: unknown. |
| --output-ignore-perfdata | Remove all the metrics from the service. The service will still have a status and an output. |
| --output-ignore-label | Remove the status label ("OK:", "WARNING:", "UNKNOWN:", CRITICAL:") from the beginning of the output. Example: 'OK: Ram Total:...' will become 'Ram Total:...' |
| --output-xml | Return the output in XML format (to send to an XML API). |
| --output-json | Return the output in JSON format (to send to a JSON API). |
| --output-openmetrics | Return the output in OpenMetrics format (to send to a tool expecting this format). |
| --output-file | Write output in file (can be combined with json, xml and openmetrics options). E.g.: --output-file=/tmp/output.txt will write the output in /tmp/output.txt. |
| --disco-format | Applies only to modes beginning with 'list-'. Returns the list of available macros to configure a service discovery rule (formatted in XML). |
| --disco-show | Applies only to modes beginning with 'list-'. Returns the list of discovered objects (formatted in XML) for service discovery. |
| --float-precision | Define the float precision for thresholds (default: 8). |
| --source-encoding | Define the character encoding of the response sent by the monitored resource Default: 'UTF-8'. Splunk API. |
| --hostname | Splunk server address. |
| --port | API port (default: 8089) |
| --proto | Specify http if needed (default: 'https') |
| --api-username | Specify api username. |
| --api-password | Specify api password. |
| --timeout | Set HTTP timeout. |
| --splunk-retries | How many times we should retry queries to splunk. To use with the --splunk-wait parameter (default: 5) |
| --splunk-wait | How long (in seconds) should we wait between each retry. To use in par with the --splunk-retries paramater (default: 2) |
| --http-peer-addr | Set the address you want to connect to. Useful if hostname is only a vhost, to avoid IP resolution. |
| --proxyurl | Proxy URL. Example: http://my.proxy:3128 |
| --proxypac | Proxy pac file (can be a URL or a local file). |
| --insecure | Accept insecure SSL connections. |
| --http-backend | Perl library to use for HTTP transactions. Possible values are: lwp (default) and curl. |
| --ssl-opt | Set SSL Options (--ssl-opt="SSL_version => TLSv1" --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"). |
| --curl-opt | Set CURL Options (--curl-opt="CURLOPT_SSL_VERIFYPEER => 0" --curl-opt="CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_1" ). |
| --memcached | Memcached server to use (only one server). |
| --redis-server | Redis server to use (only one server). Syntax: address[:port] |
| --redis-attribute | Set Redis Options (--redis-attribute="cnx_timeout=5"). |
| --redis-db | Set Redis database index. |
| --failback-file | Failback on a local file if Redis connection fails. |
| --memexpiration | Time to keep data in seconds (default: 86400). |
| --statefile-dir | Define the cache directory (default: '/var/lib/centreon/centplugins'). |
| --statefile-suffix | Define a suffix to customize the statefile name (default: ''). |
| --statefile-concat-cwd | If used with the '--statefile-dir' option, the latter's value will be used as a sub-directory of the current working directory. Useful on Windows when the plugin is compiled, as the file system and permissions are different from Linux. |
| --statefile-format | Define the format used to store the cache. Available formats: 'dumper', 'storable', 'json' (default). |
| --statefile-key | Define the key to encrypt/decrypt the cache. |
| --statefile-cipher | Define the cipher algorithm to encrypt the cache (default: 'AES'). |
Options des modes
Les options disponibles pour chaque modèle de services sont listées ci-dessous :
- Index-Update
- Query-Matches-Number
- Query-Numeric-Value
- Query-String-Value
- Splunkd-Health
| Option | Description |
|---|---|
| --index-name | Specify index name to get last updates. If not specified, all indexes are checked by default. |
| --warning-index-last-update-seconds | Warning threshold in seconds for last update. Example: --warning-index-last-update-seconds=15000 |
| --critical-index-last-update-seconds | Critical threshold in seconds for last update. Example: --critical-index-last-update-seconds=25000 |
| Option | Description |
|---|---|
| --query | Specify a query to be made and check matching number. Query has to start with "search ". Example: --query='search host="prod-server" "ERROR" earliest=-150000min' |
| --warning-query-matches | Warning threshold for query matches. Example: --warning-query-matches=5 |
| --critical-query-matches | Critical threshold for query matches. Example: --critical-query-matches=15 |
| Option | Description |
|---|---|
| --query | Specify a query to be sent to Splunk. If the query starts with '@', it is considered as a file name to read the query from. Query has to start with "search" or "|". Example: --query=C<index=main | table skippedRatio | where skippedRatio > 0.2> |
| --search-mode | Specify the search mode (default: 'auto'). Can be: 'auto', 'fast', 'smart', 'verbose'. The 'auto' value lets Splunk use its default mode. Check https://help.splunk.com/en/splunk-cloud-platform/search/search-manual/10.0.2503/using-the-search-app/search-modes for more details. |
| --include | Define the Splunk fields to be managed by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is empty (default) all fields are managed by the plugin, otherwise, only matching fields are managed. Only managed fields can be displayed and used for checks. |
| --exclude | Define the Splunk fields to be ignored by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is not empty, all matching fields are ignored by the plugin. Only managed fields can be displayed and used for checks. |
| --display | Define the Splunk fields to be displayed on perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is empty (default), all fields are displayed; otherwise, only matching fields are displayed. Fields are always displayed in the long output in verbose mode. |
| --hide | Define the Splunk fields to hide from perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is not empty, all matching fields are hidden. Fields are always displayed in the long output in verbose mode. |
| --event-field | Define the field value used to prefix the perfdata output. |
| --event-label | Label to use to prefix perfdata output (default: 'event') |
| --include-internal-field | By default fields starting with '_' are considered as internal and ignored. This option allows to include them. Example: --include-internal-field=_raw This option can be used multiple times and multiple values can be passed as a comma separated list. |
| --include-nonnumeric-field | By default all non numeric value are ignored. This option allows to include them. |
| --ok-label | Define the label to use for events that trigger the OK threshold (default: ''). |
| --warning-label | Define the label to use for events that trigger the WARNING threshold (default: 'trigger WARNING threshold'). |
| --critical-label | Define the label to use for events that trigger the CRITICAL threshold (default: 'trigger CRITICAL threshold'). |
| --perfdata-unit | Perfdata unit in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the unit are separated by an equals sign. If the [field] name is not set, the [unit] applies to all fields that do not have a defined unit. Syntax: C<--perfdata-unit=[field]=[unit]> For example to set a unit C<%> for the field C<skippedRatio>: C<--perfdata-unit=skippedRatio=%> Or to set a unit for all fields without a specific unit: C<--perfdata-unit=%> |
| --perfdata-name | Perfdata name in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the name are separated by an equals sign. If the [field] name is not set, the [name] applies to all fields that do not have a defined name. Syntax: C<--perfdata-name=[field]=[name]> For example to set name C<test> for the field C<skippedRatio>: C<--perfdata-name=skippedRatio=test> Or to set a name for all fields without a specific name: C<--perfdata-name=test> |
| --perfdata-min | Minimum value to add in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the minimum value are separated by an equals sign. If the [field] name is not set, the [minimum value] applies to all fields that do not have a defined minimum value. Syntax: C<--perfdata-min=[field]=[minimum value]> For example to set minimum value C<1> for the field C<skippedRatio>: C<--perfdata-min=skippedRatio=1> Or to set a minimum value for all fields without a specific name: C<--perfdata-min=1> |
| --perfdata-max | Maximum value to add in perfdata output. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the maximum value are separated by an equals sign. If the [field] name is not set, the [maximum value] applies to all fields that do not have a defined maximum value. Syntax: C<--perfdata-max=[field]=[maximum value]> For example to set maximum value C<100> for the field C<skippedRatio>: C<--perfdata-max=skippedRatio=100> Or to set a maximum value for all fields without a specific name: C<--perfdata-max=100> |
| --warning-count | Warning threshold for query matches. Example: --warning-count=5 |
| --critical-count | Critical threshold for query matches. Example: --critical-count=15 |
| --warning-value | Warning threshold for a specific field value. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the threshold are separated by an equals sign. If the [field] name is not set, the [threshold] applies to all fields that do not have a defined threshold. Syntax: C<--warning-value=[field]=[threshold]> For example to set a threshold of C<:1> for the field C<skippedRatio>: C<--warning-value=skippedRatio=:1> Or to set a threshold for all fields without a specific threshold: C<--warning-value=:1> You cannot define multiple thresholds for the same field. |
| --critical-value | Critical threshold for a specific field value. This option can be used multiple times and multiple values can be passed as a comma separated list. The field name and the threshold are separated by an equals sign. If the [field] name is not set, the [threshold] applies to all fields that do not have a defined threshold. Syntax: C<--critical-value=[field]=[threshold]> For example to set a threshold of C<:1> for the field C<skippedRatio>: C<--critical-value=skippedRatio=:1> Or to set a threshold for all fields without a specific threshold: C<--critical-value=:1> You cannot define multiple thresholds for the same field. |
| Option | Description |
|---|---|
| --query | Specify a query to be sent to Splunk. If the query starts with '@', it is considered as a file name to read the query from. Query has to start with "search" or "|". Example: --query=C<index=main | table skippedRatio | where skippedRatio > 0.2> |
| --search-mode | Specify the search mode (default: 'auto'). Can be: 'auto', 'fast', 'smart', 'verbose'. The 'auto' value lets Splunk use its default mode. Check https://help.splunk.com/en/splunk-cloud-platform/search/search-manual/10.0.2503/using-the-search-app/search-modes for more details. |
| --include | Define the Splunk fields to be managed by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is empty (default) all fields are managed by the plugin, otherwise, only matching fields are managed. Only managed fields can be displayed and used for checks. |
| --exclude | Define the Splunk fields to be ignored by the plugin (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. If this parameter is not empty, all matching fields are ignored by the plugin. Only managed fields can be displayed and used for checks. |
| --display | Define the Splunk fields to be displayed on perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is empty (default), all fields are displayed; otherwise, only matching fields are displayed. |
| --hide | Define the Splunk fields to hide from perfdata (can be a regexp). This option can be used multiple times and multiple values can be passed as a comma separated list. Only managed fields are considered. If this parameter is not empty, all matching fields are hidden. |
| --event-field | Define the field value used to prefix the perfdata output. |
| --event-label | Label to use to prefix perfdata output (default: 'event') |
| --include-internal-field | By default fields starting with '_' are considered as internal and ignored. This option allows to include them. Example: --include-internal-field=_raw This option can be used multiple times and multiple values can be passed as a comma separated list. |
| --ok-label | Define the label to use for events that trigger the OK threshold (default: ''). |
| --warning-label | Define the label to use for events that trigger the WARNING threshold (default: 'trigger WARNING threshold'). |
| --critical-label | Define the label to use for events that trigger the CRITICAL threshold (default: 'trigger CRITICAL threshold'). |
| --warning-count | Warning threshold for query matches. Example: --warning-count=5 |
| --critical-count | Critical threshold for query matches. Example: --critical-count=15 |
| --warning-value | Define the conditions to match for the status to be WARNING. Field names can be used as variables, and complex expressions are supported. Example: --warning-value='%{sourcetype} =~ /orchestrator/' |
| --critical-value | Define the conditions to match for the status to be CRITICAL. Field names can be used as variables, and complex expressions are supported. Example: --warning-value='%{sourcetype} =~ /orchestrator/' |
| Option | Description |
|---|---|
| --warning-* | Warning thresholds for features status. (default: '%{status} =~ /yellow/'). Can be: 'file-monitor-input-status', 'index-processor-status', 'resource-usage-status', 'search-scheduler-status', 'workload-management-status' |
| --critical-* | Critical thresholds for features status. (default: '%{status} =~ /red/'). Can be: 'file-monitor-input-status', 'index-processor-status', 'resource-usage-status', 'search-scheduler-status', 'workload-management-status' |
Pour un mode, la liste de toutes les options disponibles et leur signification peut être
affichée en ajoutant le paramètre --help à la commande :
/usr/lib/centreon/plugins/centreon_monitoring_splunk_api.pl \
--plugin=apps::monitoring::splunk::plugin \
--mode=query \
--help