Skip to content

Commit a0c9c3c

Browse files
committed
ITL docs: Replace unmaintained anchor/nagios-plugin-elasticsearch
Replaced with the currently maintained NETWAYS/check_elasticsearch
1 parent a218ba8 commit a0c9c3c

File tree

2 files changed

+72
-33
lines changed

2 files changed

+72
-33
lines changed

doc/10-icinga-template-library.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,19 +2761,20 @@ mongodb_disableretrywrites | **Optional.** If set to true, will disable Re
27612761

27622762
#### elasticsearch <a id="plugin-contrib-command-elasticsearch"></a>
27632763

2764-
The [check_elasticsearch](https://github.com/anchor/nagios-plugin-elasticsearch) plugin
2764+
The [check_elasticsearch](https://github.com/NETWAYS/check_elasticsearch) plugin
27652765
uses the HTTP API to monitor an [Elasticsearch](https://www.elastic.co/products/elasticsearch) node.
27662766

27672767
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
27682768

27692769
Name | Description
27702770
-----------------------------|-------------------------------------------------------------------------------------------------------
27712771
elasticsearch_host | **Optional.** Hostname or network address to probe. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
2772-
elasticsearch_failuredomain | **Optional.** A comma-separated list of ElasticSearch attributes that make up your cluster's failure domain.
2773-
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.
27742772
elasticsearch_port | **Optional.** TCP port to probe. The ElasticSearch API should be listening here. Defaults to 9200.
2775-
elasticsearch_prefix | **Optional.** Optional prefix (e.g. 'es') for the ElasticSearch API. Defaults to ''.
2776-
elasticsearch_yellowcritical | **Optional.** Instead of issuing a 'warning' for a yellow cluster state, issue a 'critical' alert. Defaults to false.
2773+
elasticsearch_username | **Optional.** Username if authentication is required
2774+
elasticsearch_password | **Optional.** Password if authentication is required
2775+
elasticsearch_timeout | **Optional.** Allows to set timeout for execution of this plugin.
2776+
elasticsearch_tls | **Optional.** Use a HTTPS connection (default false)
2777+
elasticsearch_insecure | **Optional.** Skip the verification of the server's TLS certificate (default false)
27772778

27782779
#### redis <a id="plugin-contrib-command-redis"></a>
27792780

itl/plugins-contrib.d/databases.conf

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -722,41 +722,79 @@ object CheckCommand "mongodb" {
722722
vars.mongodb_action = "connections"
723723
}
724724

725-
object CheckCommand "elasticsearch" {
725+
template CheckCommand "elasticsearch" {
726726
import "ipv4-or-ipv6"
727727

728-
command = [ PluginContribDir + "/check_elasticsearch" ]
728+
command = [ PluginDir + "/check_elasticsearch" ]
729729

730730
arguments = {
731-
"--failure-domain" = {
732-
value = "$elasticsearch_failuredomain$"
733-
description = "A comma-separated list of ElasticSearch attributes that make up your cluster's failure domain"
734-
}
735-
"--host" = {
736-
value = "$elasticsearch_host$"
737-
description = "Hostname or network address to probe, defaults to 'localhost'"
738-
}
739-
"--master-nodes" = {
740-
value = "$elasticsearch_masternodes$"
741-
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"
742-
}
743-
"--port" = {
744-
value = "$elasticsearch_port$"
745-
description = "TCP port to probe, defaults to 9200"
746-
}
747-
"--prefix" = {
748-
value = "$elasticsearch_prefix$"
749-
description = "Optional prefix for the ElasticSearch API, defaults to ''"
750-
}
751-
"--yellow-critical" = {
752-
value = "TRUE"
753-
set_if = "$elasticsearch_yellowcritical$"
754-
description = "Instead of issuing a 'warning' for a yellow cluster state, issue a 'critical' alert"
731+
-H" = {
732+
value = "$elasticsearch_hostname$"
733+
description = "Hostname of the Elasticsearch instance (default 'localhost')"
734+
}
735+
"-p" = {
736+
value= "$elasticsearch_port$"
737+
description = "Port of the Elasticsearch instance (default 9200)"
738+
}
739+
"-U" = {
740+
value = "$elasticsearch_username$"
741+
description = "Username if authentication is required"
742+
}
743+
"-P" = {
744+
value = "$elasticsearch_password$"
745+
description = "Password if authentication is required"
746+
}
747+
"-S" = {
748+
set_if = "$elasticsearch_tls$"
749+
description = "Use a HTTPS connection (default false)"
750+
}
751+
"--insecure" = {
752+
set_if = "$elasticsearch_insecure$"
753+
description = "Skip the verification of the server's TLS certificate (default false)"
754+
}
755+
"-t" = {
756+
value = "$elasticsearch_timeout$"
757+
description = "Timeout in seconds for the CheckPlugin (default 30)"
758+
}}
759+
}
760+
761+
object CheckCommand "elasticsearch-query" {
762+
import "elasticsearch"
763+
764+
command += [ "query" ]
765+
766+
arguments += {
767+
"-q" = {
768+
value = "$elasticsearch_query$"
769+
description = "The Elasticsearch query"
770+
}
771+
"-I" = {
772+
value = "$elasticsearch_query_index$"
773+
description = "Name of the Index which will be used (default '_all')"
774+
}
775+
"-k" = {
776+
value = "$elasticsearch_query_msgkey$"
777+
description = "Message of messagekey to display"
778+
}
779+
"-m" = {
780+
value = "$elasticsearch_query_msglen$"
781+
description = "Number of characters to display in the latest message (default 80)"
782+
}
783+
"-w" = {
784+
value = "$elasticsearch_query_warning$"
785+
description = "Warning threshold for total hits (default '20')"
786+
}
787+
"-c" = {
788+
value = "$elasticsearch_query_critical$"
789+
description = "Critical threshold for total hits (default '50')"
755790
}
756791
}
792+
}
793+
794+
object CheckCommand "elasticsearch-health" {
795+
import "elasticsearch"
757796

758-
vars.elasticsearch_host = "$check_address$"
759-
vars.elasticsearch_yellowcritical = false
797+
command += [ "health" ]
760798
}
761799

762800
object CheckCommand "redis" {

0 commit comments

Comments
 (0)