check_es 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,25 +1,12 @@
1
- check_graphite is a nagios module to query graphite
1
+ check_es is a nagios module to query elastic search status
2
2
 
3
3
  ## Example
4
4
 
5
- check_graphite -H 'http://my.graphite.host
5
+ check_es -H http://192.168.1.1:9200 -w 12 -c 10
6
6
 
7
- check_graphite -H "http://your.graphite.host/render" -M collectd.somebox.load.load.midterm -w 1 -c 2 -N load
8
- WARNING|load=1.4400000000000002;;;;
7
+ check_es accepts the following options:
9
8
 
10
- check_graphite accepts the following options:
11
-
12
- * `-H` or `--endpoint`: the graphite HTTP endpoint which can be queried
13
- * `-M' or `--metric`: the metric expression which will be queried, it can be an expression
14
- * `-F` or `--from`: time frame for which to query metrics, defaults to "30seconds"
15
- * `-N` or `--name`: name to give to the metric, defaults to "value"
16
- * `-w`: warning threshold for the metric
17
- * `-c`: critical threshold for the metric
9
+ * `-H` or `--endpoint`: the elastic search HTTP endpoint which can be queried
10
+ * `-c`: critical threshold for the live number of nodes
18
11
  * `-t`: timeout after which the metric should be considered unknown
19
12
 
20
- ## How it works
21
-
22
- check_graphite, asks for a small window of metrics, and computes an average over the last valid
23
- points collected, it then checks the value against supplied thresholds.
24
-
25
- NaN values are not taken into account in the average
data/lib/check_es.rb CHANGED
@@ -8,11 +8,9 @@ module CheckES
8
8
  class Command
9
9
  include NagiosCheck
10
10
 
11
- on "--endpoint ENDPOINT", "-H ENDPOINT", :mandatory
11
+ on "--endpoint ENDPOINT", "-H ENDPOINT", :default => "http://localhost:9200"
12
12
 
13
- enable_warning
14
13
  enable_critical
15
- enable_timeout
16
14
 
17
15
  def check
18
16
  data = Http.get "#{options.endpoint}/_cluster/health"
@@ -21,10 +19,9 @@ module CheckES
21
19
 
22
20
  if status != 'green'
23
21
  store_message "cluster status is #{status} with #{nodes} nodes"
24
- store_value :nodes, nodes
25
- 0
22
+ store_value :nodes, 0
26
23
  else
27
- nodes.to_i
24
+ store_value :nodes, nodes
28
25
  end
29
26
  end
30
27
  end
@@ -1,3 +1,3 @@
1
1
  module CheckES
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check_es
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-31 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nagios_check
16
- requirement: &13001980 !ruby/object:Gem::Requirement
16
+ requirement: &11885060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13001980
24
+ version_requirements: *11885060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: http
27
- requirement: &13001400 !ruby/object:Gem::Requirement
27
+ requirement: &11884260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13001400
35
+ version_requirements: *11884260
36
36
  description: check values from a es server
37
37
  email:
38
38
  - pyr@spootnik.org