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 +4 -4
- data/CHANGELOG.md +5 -1
- data/bin/check-es-query-ratio.rb +11 -1
- data/lib/sensu-plugins-elasticsearch/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 43c1d22dfed96437693246e301dbbdd3e2ae8c8b
|
|
4
|
+
data.tar.gz: 26b3f05c74c87d31a49fc60403341a8a3c867258
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc43f23476689f07200d3267e9833e6ca50b2b47f7c72cc2cb3d1ef92fc7cdd881dffb8c29ec2edb659a03d60af7f5f6c01908db7b540078b84ab6713557b361
|
|
7
|
+
data.tar.gz: ecdcae5ca860a180c64731eacb0992d88920c4d242b15cacf32fe7a089f4dd5d46301cef85f0e9bd19800bb5360a06e667725edb1b631ead8b2b00f7f3ca978f
|
data/CHANGELOG.md
CHANGED
|
@@ -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.
|
|
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
|
data/bin/check-es-query-ratio.rb
CHANGED
|
@@ -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
|
-
|
|
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 = {}
|
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.
|
|
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-
|
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|