From e88cc78a4f0304f8aeafc339e41e8bff45a8ea5f Mon Sep 17 00:00:00 2001 From: Dirk Goetz Date: Mon, 15 Jun 2015 15:09:18 +0200 Subject: [PATCH] Add elasticsearch checkcommand to itl fixes #9415 Signed-off-by: Michael Friedrich --- doc/7-icinga-template-library.md | 15 ++++++++++++ itl/plugins-contrib.d/databases.conf | 36 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index b1ec72f54..198c0d27c 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -1457,6 +1457,21 @@ mongodb_querytype | **Optional.** The query type to check [query| mongodb_collection | **Optional.** Specify the collection to check mongodb_sampletime | **Optional.** Time used to sample number of pages faults +### elasticsearch + +An ElasticSearch availability and performance monitoring plugin for Nagios provided by [Anchor](http://www.anchor.com.au) on [https://github.com](https://github.com/anchor/nagios-plugin-elasticsearch). +It ulitizes the API so requires HTTP enabled for your elasticsearch node. + +Name | Description +-----------------------------|------------------------------------------------------------------------------------------------------- +elasticsearch_failuredomain | **Optional.** A comma-separated list of ElasticSearch attributes that make up your cluster's failure domain. +elasticsearch_host | **Optional.** Hostname or network address to probe. Defaults to 'localhost'. +elasticsearch_masternodes | **Optional.** Issue a warning if the number of master-eligible nodes in the cluster drops below this number. By default, do not monitor the number of nodes in the cluster. +elasticsearch_port | **Optional.** TCP port to probe. The ElasticSearch API should be listening here. Defaults to 9200. +elasticsearch_prefix | **Optional.** Optional prefix (e.g. 'es') for the ElasticSearch API. Defaults to ''. +elasticsearch_yellowcritical | **Optional.** Instead of issuing a 'warning' for a yellow cluster state, issue a 'critical' alert. Defaults to false. + + ## IPMI Devices This category includes all plugins for IPMI devices. diff --git a/itl/plugins-contrib.d/databases.conf b/itl/plugins-contrib.d/databases.conf index c98c27bf8..09ffe0f44 100644 --- a/itl/plugins-contrib.d/databases.conf +++ b/itl/plugins-contrib.d/databases.conf @@ -383,3 +383,39 @@ object CheckCommand "mongodb" { vars.mongodb_perfdata = true vars.mongodb_action = "connections" } + +object CheckCommand "elasticsearch" { + import "plugin-check-command" + + command = [ PluginDir + "/check_elasticsearch" ] + + arguments = { + "--failure-domain" = { + value = "$elasticsearch_failuredomain$" + description = "A comma-separated list of ElasticSearch attributes that make up your cluster's failure domain" + } + "--host" = { + value = "$elasticsearch_host$" + description = "Hostname or network address to probe, defaults to 'localhost'" + } + "--master-nodes" = { + value = "$elasticsearch_masternodes$" + description = "Issue a warning if the number of master-eligible nodes in the cluster drops below this number. By default, do not monitor the number of nodes in the cluster" + } + "--port" = { + value = "$elasticsearch_port$" + description = "TCP port to probe, defaults to 9200" + } + "--prefix" = { + value = "$elasticsearch_prefix$" + description = "Optional prefix for the ElasticSearch API, defaults to ''" + } + "--yellow-critical" = { + value = "TRUE" + set_if = "$elasticsearch_yellowcritical$" + description = "Instead of issuing a 'warning' for a yellow cluster state, issue a 'critical' alert" + } + } + + vars.elasticsearch_yellowcritical = false +}