55
66## Usage
77
8+ ```
9+ Usage:
10+ check_elasticsearch [flags]
11+ check_elasticsearch [command]
12+
13+ Available Commands:
14+ health Checks the health status of an Elasticsearch cluster
15+ query Checks the total hits/results of an Elasticsearch query
16+
17+ Flags:
18+ -H, --hostname string Hostname of the Elasticsearch instance (default "localhost")
19+ -p, --port int Port of the Elasticsearch instance (default 9200)
20+ -U, --username string Username if authentication is required
21+ -P, --password string Password if authentication is required
22+ -S, --tls Use a HTTPS connection
23+ --insecure Skip the verification of the server's TLS certificate
24+ -t, --timeout int Timeout in seconds for the CheckPlugin (default 30)
25+ -h, --help help for check_elasticsearch
26+ -v, --version version for check_elasticsearch
27+ ```
28+
829### Health
930
1031Checks the health status of an Elasticsearch cluster.
@@ -13,26 +34,22 @@ Checks the health status of an Elasticsearch cluster.
1334Usage:
1435 check_elasticsearch health
1536
16- Flags:
17- -h, --help help for health
18-
19- Global Flags:
20- -H, --hostname string Hostname or ip address of elasticsearch node (default "localhost")
21- --insecure Allow use of self signed certificates when using SSL
22- -P, --password string Password if authentication is required
23- -p, --port int Port of elasticsearch node (default 9200)
24- -S, --tls Use secure connection
25- -U, --username string Username if authentication is required
37+ The cluster health status is:
38+ green = OK
39+ yellow = WARNING
40+ red = CRITICAL
2641```
2742
28- #### Elasticsearch cluster with green status (all nodes are running)
43+ Examples:
44+
45+ Elasticsearch cluster with green status (all nodes are running):
2946
3047```
3148$ check_elasticsearch health -U exampleuser -P examplepassword -S --insecure
3249OK - Cluster es-example-cluster is green | status=0 nodes=3 data_nodes=3 active_primary_shards=10 active_shards=20
3350```
3451
35- #### Elasticsearch cluster with yellow status (not all nodes are running)
52+ Elasticsearch cluster with yellow status (not all nodes are running):
3653
3754```
3855$ check_elasticsearch health -U exampleuser -P examplepassword -S --insecure
@@ -41,31 +58,34 @@ WARNING - Cluster es-example-cluster is yellow | status=1 nodes=2 data_nodes=2 a
4158
4259### Query
4360
44- Checks the total hits/results of an Elasticsearch query.<br >
45- The plugin is currently capable to return the total hits of documents based on a provided query string.
61+ Checks the total hits/results of an Elasticsearch query.
62+
63+ Hint: The plugin is currently capable to return the total hits of documents based on a provided query string.
4664
4765```
4866Usage:
4967 check_elasticsearch query [flags]
5068
5169Flags:
52- -q, --query string Elasticsearch query
53- -I, --index string The index which will be used (default "_all")
54- -k, --msgkey string Message of messagekey to display
55- -m, --msglen int Number of characters to display in latest message (default 80)
56- -w, --warning uint Warning threshold for total hits (default 20 )
57- -c, --critical uint Critical threshold for total hits (default 50 )
58- -h, --help help for query
70+ -q, --query string The Elasticsearch query
71+ -I, --index string Name of the Index which will be used (default "_all")
72+ -k, --msgkey string Message of messagekey to display
73+ -m, --msglen int Number of characters to display in the latest message (default 80)
74+ -w, --warning string Warning threshold for total hits (default "20" )
75+ -c, --critical string Critical threshold for total hits (default "50" )
76+ -h, --help help for query
5977```
6078
61- #### Search for total hits without any message
79+ Examples:
80+
81+ Search for total hits without any message:
6282
6383```
6484$ check_elasticsearch query -q "event.dataset:sample_web_logs and @timestamp:[now-5m TO now]" -I "kibana_sample_data_logs"
6585CRITICAL - Total hits: 14074 | total=14074;20;50
6686```
6787
68- #### Search for total hits with message
88+ Search for total hits with message:
6989
7090```
7191$ check_elasticsearch query -q "event.dataset:sample_web_logs and @timestamp:[now-5m TO now]" -I "kibana_sample_data_logs" -k "message"
0 commit comments