sensu-plugins-elasticsearch 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 720cdc17b2d10fcdfc68c0dbd0532e9d4e294c028b73af28100ab4c1aa306d79
4
- data.tar.gz: 55b1d09d531b425f4e7de7f9adda6ab74b86a1ef6cbe0336d5fd6e6450c33312
3
+ metadata.gz: 6b22a38f736dceb2b5f955a7fe3905e049e76f5c4bbf9a3936b33442a049f921
4
+ data.tar.gz: 8f7a784cf59a113268d6d74cec17bb9ed1d54fff32aa1bdcb9e8ceedfe52cab4
5
5
  SHA512:
6
- metadata.gz: c22aaa388381a3a69daff55f291c7e5ae4a29939fcac6c542acaa80d1a99f49a11482907eac33a60c1b9cf768bd4b424316b2786cc57c3721c3b54c1b1c3274e
7
- data.tar.gz: a87a86da753f25aae078b6fc28ed93198c3551d58e9f7a6ba230ee3b7d492758fc59357a67f51583fdaa63917d7755a9a95ddc112b9cef8f3927e6d47beca7fb
6
+ metadata.gz: 941aa2d8224ee7a2da2c1b7095363c30c24dcfd0921830ac379379640179e78c3ccb89172cce9e3b41d43ad5a5cd4009dee26dd727ad7f08addf9151dd67d848
7
+ data.tar.gz: 539cb8886f527d092fa7dd8a5a9021649c5477612b1bca9f617574aa5cc1f9a69ade798f9561cb0da4249df26cd4f17ac8570e8f2f0b4522ff98bc6f9ca8117a
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.9.0] - 2018-02-19
9
+ ### Changed
10
+ - bin/check-es-node-status.rb: updated to check the status of all nodes in a cluster (@cihangirbesiktas)
11
+
8
12
  ## [1.8.1] - 2018-02-15
9
13
  ### Fixed
10
14
  - metrics-es-cluster.rb: Don't try to fetch percolator stats on ES 5+, those stats have been removed (@eheydrick)
@@ -209,7 +213,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
209
213
  - initial release
210
214
 
211
215
 
212
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.8.1...HEAD
216
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.9.0...HEAD
217
+ [1.9.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.8.1.9.0
213
218
  [1.8.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.8.0...1.8.1
214
219
  [1.8.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.7.1...1.8.0
215
220
  [1.7.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.7.0...1.7.1
@@ -68,6 +68,12 @@ class ESNodeStatus < Sensu::Plugin::Check::CLI
68
68
  short: '-e',
69
69
  long: '--https'
70
70
 
71
+ option :all,
72
+ description: 'Check all nodes in the ES cluster',
73
+ short: '-a',
74
+ long: '--all',
75
+ default: false
76
+
71
77
  def get_es_resource(resource)
72
78
  headers = {}
73
79
  if config[:user] && config[:password]
@@ -92,17 +98,27 @@ class ESNodeStatus < Sensu::Plugin::Check::CLI
92
98
  end
93
99
 
94
100
  def acquire_status
95
- status = get_es_resource('/').code
101
+ status = get_es_resource('/_nodes/stats')
96
102
  status
97
103
  end
98
104
 
99
105
  def run
100
- node_status = acquire_status
106
+ stats = acquire_status
101
107
 
102
- if node_status == 200
103
- ok "Alive #{node_status}"
108
+ if stats.code == 200
109
+ if config[:all]
110
+ total = stats['_nodes']['total']
111
+ successful = stats['_nodes']['successful']
112
+ if total == successful
113
+ ok 'Alive - all nodes'
114
+ else
115
+ critical 'Dead - one or more nodes'
116
+ end
117
+ else
118
+ ok "Alive #{stats.code}"
119
+ end
104
120
  else
105
- critical "Dead (#{node_status})"
121
+ critical "Dead (#{stats.code})"
106
122
  end
107
123
  end
108
124
  end
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsElasticsearch
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 8
5
- PATCH = 1
4
+ MINOR = 9
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
294
  version: '0'
295
295
  requirements: []
296
296
  rubyforge_project:
297
- rubygems_version: 2.7.5
297
+ rubygems_version: 2.7.6
298
298
  signing_key:
299
299
  specification_version: 4
300
300
  summary: Sensu plugins for elasticsearch