sensu-plugins-elasticsearch 1.5.3 → 1.6.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
  SHA1:
3
- metadata.gz: 4c7ade9ede1e2715cb933aea04162f5f9bbe281d
4
- data.tar.gz: d44a555d474eb50d94a0c50befff77aff242f5e9
3
+ metadata.gz: 43c1d22dfed96437693246e301dbbdd3e2ae8c8b
4
+ data.tar.gz: 26b3f05c74c87d31a49fc60403341a8a3c867258
5
5
  SHA512:
6
- metadata.gz: 9b33664bd870d93535587c5389a6c4f03edd73cfdeaeb8f22d81c4a70b67bfccb476892abac957c18aa4f038f881c3159ebc39a1d0d2155b33a07904da2b1d05
7
- data.tar.gz: 9ccb0dc7dfdb2703da8d6cc71c984bf17c4d3922e0b72e836113c302a1b4aa886401a30bc564ef0a58839911b578e98c8ed60a3edfb1e887a18c5a5d6ef1d480
6
+ metadata.gz: fc43f23476689f07200d3267e9833e6ca50b2b47f7c72cc2cb3d1ef92fc7cdd881dffb8c29ec2edb659a03d60af7f5f6c01908db7b540078b84ab6713557b361
7
+ data.tar.gz: ecdcae5ca860a180c64731eacb0992d88920c4d242b15cacf32fe7a089f4dd5d46301cef85f0e9bd19800bb5360a06e667725edb1b631ead8b2b00f7f3ca978f
@@ -5,6 +5,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.6.0] - 2017-08-18
9
+ ### Added
10
+ - bin/check-es-query-ratio.rb: added option to avoid triggering alert if divisor is 0 (@cgarciaarano)
8
11
 
9
12
  ## [1.5.3] - 2017-08-17
10
13
  ### Fixed
@@ -181,7 +184,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
181
184
  - initial release
182
185
 
183
186
 
184
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.2...HEAD
187
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.6.0...HEAD
188
+ [1.6.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.3...1.6.0
185
189
  [1.5.3]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.2...1.5.3
186
190
  [1.5.2]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.1...1.5.2
187
191
  [1.5.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.0...1.5.1
@@ -205,6 +205,13 @@ class ESQueryRatio < Sensu::Plugin::Check::CLI
205
205
  description: 'Invert thresholds',
206
206
  boolean: true
207
207
 
208
+ option :divisor_zero_ok,
209
+ short: '-z',
210
+ long: '--zero',
211
+ description: 'Division by 0 returns OK',
212
+ boolean: true,
213
+ default: false
214
+
208
215
  option :kibana_url,
209
216
  long: '--kibana-url KIBANA_URL',
210
217
  description: 'Kibana URL query prefix that will be in critical / warning response output.'
@@ -253,7 +260,10 @@ class ESQueryRatio < Sensu::Plugin::Check::CLI
253
260
  dividend = client.count(build_request_options)
254
261
  config[:query] = divisor_query
255
262
  divisor = client.count(build_request_options)
256
- if divisor['count'] == 0
263
+ divisor_zero_ok = config[:divisor_zero_ok]
264
+ if divisor_zero_ok && divisor['count'].zero?
265
+ ok 'Divisor is 0, ratio check cannot be performed, failing safe with ok'
266
+ elsif divisor['count'].zero?
257
267
  critical 'Divisor is 0, ratio check cannot be performed, raising an alert'
258
268
  else
259
269
  response = {}
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsElasticsearch
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 5
5
- PATCH = 3
4
+ MINOR = 6
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.5.3
4
+ version: 1.6.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: 2017-08-17 00:00:00.000000000 Z
11
+ date: 2017-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client