sensu-plugins-elasticsearch 1.6.1 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccac27672694127e79e44c35ae89993cb3fd2d8c
4
- data.tar.gz: 3ced80ebfa6e4cf4ffbc7511fbfe1f016a592914
3
+ metadata.gz: 9b5d19c687717bb77c715fe191176912e2b4eeb0
4
+ data.tar.gz: ba45b265535b3a4829e2ffbde77994a9f0c8367a
5
5
  SHA512:
6
- metadata.gz: cbed78893141f38b9021029317d2e244c909d5561f2bf8142dfba347a0da762a55c4c1666c41c754ed664c7486aa613b32e63f5af1e88c165ec20d1c56ff8016
7
- data.tar.gz: 9f82647ee3f664b850bdde81e780161433365801b8d843ab7ee5d117a289a3631edc353d8674e97544ff73f4ddb4ff30e994e557df0be0bc25c9ef13a5b58993
6
+ metadata.gz: 9ccf40f6c0612d23fe4f46215497f68c61109243dca77ca4da7f47808242f7371b20083f5c239d94a662e3f6fd3eb1467e26d1cee8975abb9bb1570bd7aaa374
7
+ data.tar.gz: 659d435cabed3488b826d6f1a4b8947e86bbe43655b3f6fd761f0414be487e75242cdd8fffb0c70be764cb22aea617d98c3b75eb116a7711945fac08e9981e82
data/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.7.1] - 2017-09-18
9
+ ### Fixed
10
+ - bin/check-es-cluster-health.rb and bin/check-es-cluster-status.rb fixed --alert-status failing to alert and allow absent value to alert on any status (@rwky)
11
+
12
+ ## [1.7.0] - 2017-09-16
13
+ ### Changed
14
+ - check-es-cluster-health.rb: changed `--alert_status` to `--alert-status` to be more consistent with conventions, restrict `--alert-status` to the actual acceptable options. (@majormoses)
15
+ - check-es-cluster-status.rb: changed `--alert_status` to `--alert-status` to be more consistent with conventions, restrict `--alert-status` to the actual acceptable options. (@majormoses)
16
+
17
+ ### Added
18
+ - bin/check-es-cluster-health.rb: added option to alert only during a yellow state or only during a red state (@barrebre)
19
+ - bin/check-es-cluster-status.rb: added option to alert only during a yellow state or only during a red state (@barrebre)
20
+
8
21
  ## [1.6.1] - 2017-08-24
9
22
  ### Fixed
10
23
  - bin/check-es-query-ratio.rb: added support to define float thresholds (@cgarciaarano)
@@ -187,7 +200,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
187
200
  - initial release
188
201
 
189
202
 
190
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.6.1...HEAD
203
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.7.1...HEAD
204
+ [1.7.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.7.0...1.7.1
205
+ [1.7.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.6.1...1.7.0
191
206
  [1.6.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.6.0...1.6.1
192
207
  [1.6.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.3...1.6.0
193
208
  [1.5.3]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.5.2...1.5.3
@@ -92,6 +92,12 @@ class ESClusterHealth < Sensu::Plugin::Check::CLI
92
92
  proc: proc(&:to_i),
93
93
  default: 30
94
94
 
95
+ option :alert_status,
96
+ description: 'Only alert when status matches given RED/YELLOW/GREEN or if blank all statuses',
97
+ long: '--alert-status STATUS',
98
+ default: '',
99
+ in: ['RED', 'YELLOW', 'GREEN', '']
100
+
95
101
  def run
96
102
  options = {}
97
103
  unless config[:level].nil?
@@ -106,9 +112,17 @@ class ESClusterHealth < Sensu::Plugin::Check::CLI
106
112
  health = client.cluster.health options
107
113
  case health['status']
108
114
  when 'yellow'
109
- warning 'Cluster state is Yellow'
115
+ if ['YELLOW', ''].include? config[:alert_status]
116
+ warning 'Cluster state is Yellow'
117
+ else
118
+ ok 'Not alerting on yellow'
119
+ end
110
120
  when 'red'
111
- critical 'Cluster state is Red'
121
+ if ['RED', ''].include? config[:alert_status]
122
+ critical 'Cluster state is Red'
123
+ else
124
+ ok 'Not alerting on red'
125
+ end
112
126
  when 'green'
113
127
  ok
114
128
  else
@@ -83,6 +83,12 @@ class ESClusterStatus < Sensu::Plugin::Check::CLI
83
83
  short: '-e',
84
84
  long: '--https'
85
85
 
86
+ option :alert_status,
87
+ description: 'Only alert when status matches given RED/YELLOW/GREEN or if blank all statuses',
88
+ long: '--alert-status STATUS',
89
+ default: '',
90
+ in: ['RED', 'YELLOW', 'GREEN', '']
91
+
86
92
  def get_es_resource(resource)
87
93
  headers = {}
88
94
  if config[:user] && config[:password]
@@ -139,9 +145,17 @@ class ESClusterStatus < Sensu::Plugin::Check::CLI
139
145
  when 'green'
140
146
  ok 'Cluster is green'
141
147
  when 'yellow'
142
- warning 'Cluster is yellow'
148
+ if ['YELLOW', ''].include? config[:alert_status]
149
+ warning 'Cluster state is Yellow'
150
+ else
151
+ ok 'Not alerting on yellow'
152
+ end
143
153
  when 'red'
144
- critical 'Cluster is red'
154
+ if ['RED', ''].include? config[:alert_status]
155
+ critical 'Cluster state is Red'
156
+ else
157
+ ok 'Not alerting on red'
158
+ end
145
159
  end
146
160
  else
147
161
  ok 'Not the master'
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsElasticsearch
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 6
4
+ MINOR = 7
5
5
  PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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.6.1
4
+ version: 1.7.1
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-25 00:00:00.000000000 Z
11
+ date: 2017-09-18 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.4.5
297
+ rubygems_version: 2.6.13
298
298
  signing_key:
299
299
  specification_version: 4
300
300
  summary: Sensu plugins for elasticsearch