5
5
6
6
## Usage
7
7
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
+
8
29
### Health
9
30
10
31
Checks the health status of an Elasticsearch cluster.
@@ -13,26 +34,22 @@ Checks the health status of an Elasticsearch cluster.
13
34
Usage:
14
35
check_elasticsearch health
15
36
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
26
41
```
27
42
28
- #### Elasticsearch cluster with green status (all nodes are running)
43
+ Examples:
44
+
45
+ Elasticsearch cluster with green status (all nodes are running):
29
46
30
47
```
31
48
$ check_elasticsearch health -U exampleuser -P examplepassword -S --insecure
32
49
OK - Cluster es-example-cluster is green | status=0 nodes=3 data_nodes=3 active_primary_shards=10 active_shards=20
33
50
```
34
51
35
- #### Elasticsearch cluster with yellow status (not all nodes are running)
52
+ Elasticsearch cluster with yellow status (not all nodes are running):
36
53
37
54
```
38
55
$ 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
41
58
42
59
### Query
43
60
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.
46
64
47
65
```
48
66
Usage:
49
67
check_elasticsearch query [flags]
50
68
51
69
Flags:
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
59
77
```
60
78
61
- #### Search for total hits without any message
79
+ Examples:
80
+
81
+ Search for total hits without any message:
62
82
63
83
```
64
84
$ check_elasticsearch query -q "event.dataset:sample_web_logs and @timestamp:[now-5m TO now]" -I "kibana_sample_data_logs"
65
85
CRITICAL - Total hits: 14074 | total=14074;20;50
66
86
```
67
87
68
- #### Search for total hits with message
88
+ Search for total hits with message:
69
89
70
90
```
71
91
$ 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