|
| 1 | +template CheckCommand "elasticsearch-netways" { |
| 2 | + command = [ PluginDir + "/check_elasticsearch" ] |
| 3 | + |
| 4 | + arguments = { |
| 5 | + "-H" = { |
| 6 | + value = "$elasticsearch_hostname$" |
| 7 | + description = "Hostname of the Elasticsearch instance (default 'localhost')" |
| 8 | + } |
| 9 | + "-p" = { |
| 10 | + value= "$elasticsearch_port$" |
| 11 | + description = "Port of the Elasticsearch instance (default 9200)" |
| 12 | + } |
| 13 | + "-U" = { |
| 14 | + value = "$elasticsearch_username$" |
| 15 | + description = "Username if authentication is required" |
| 16 | + } |
| 17 | + "-P" = { |
| 18 | + value = "$elasticsearch_password$" |
| 19 | + description = "Password if authentication is required" |
| 20 | + } |
| 21 | + "-S" = { |
| 22 | + set_if = "$elasticsearch_tls$" |
| 23 | + description = "Use a HTTPS connection (default false)" |
| 24 | + } |
| 25 | + "--insecure" = { |
| 26 | + set_if = "$elasticsearch_insecure$" |
| 27 | + description = "Skip the verification of the server's TLS certificate (default false)" |
| 28 | + } |
| 29 | + "-t" = { |
| 30 | + value = "$elasticsearch_timeout$" |
| 31 | + description = "Timeout in seconds for the CheckPlugin (default 30)" |
| 32 | + } |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +object CheckCommand "elasticsearch-query" { |
| 37 | + import "elasticsearch-netways" |
| 38 | + |
| 39 | + command += [ "query" ] |
| 40 | + |
| 41 | + arguments += { |
| 42 | + "-q" = { |
| 43 | + value = "$elasticsearch_query$" |
| 44 | + description = "The Elasticsearch query" |
| 45 | + } |
| 46 | + "-I" = { |
| 47 | + value = "$elasticsearch_query_index$" |
| 48 | + description = "Name of the Index which will be used (default '_all')" |
| 49 | + } |
| 50 | + "-k" = { |
| 51 | + value = "$elasticsearch_query_msgkey$" |
| 52 | + description = "Message of messagekey to display" |
| 53 | + } |
| 54 | + "-m" = { |
| 55 | + value = "$elasticsearch_query_msglen$" |
| 56 | + description = "Number of characters to display in the latest message (default 80)" |
| 57 | + } |
| 58 | + "-w" = { |
| 59 | + value = "$elasticsearch_query_warning$" |
| 60 | + description = "Warning threshold for total hits (default '20')" |
| 61 | + } |
| 62 | + "-c" = { |
| 63 | + value = "$elasticsearch_query_critical$" |
| 64 | + description = "Critical threshold for total hits (default '50')" |
| 65 | + } |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +object CheckCommand "elasticsearch-health" { |
| 70 | + import "elasticsearch-netways" |
| 71 | + |
| 72 | + command += [ "health" ] |
| 73 | +} |
0 commit comments