sensu-plugins-http 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/bin/check-http-json.rb +12 -4
- data/lib/sensu-plugins-http/version.rb +1 -1
- metadata +25 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88ff01536d3762c191dbaa90aebc957dc204a196cb09426e906f3b3382217e13
|
4
|
+
data.tar.gz: c4dfe411edd79a341a79db744ce95473d82fdb9b831690b165553ec9e0586cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea9038170f563bf80d25dda0ee53e59a8daf143e73147d523b74f3f64858d1474fdbeea64f8f6a423e5e865d3dc749f8b6b5a382e954c3b29c60d7ae6b8cbe22
|
7
|
+
data.tar.gz: da62f1a6be047b11e8bed39366b649439a99d8152e7b786ec9cd9b512277a1389ae67df552453858eb545f0f1ee15261220c85cd46b01f8239f5a0833a57d26c
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.8.0] 2018-02-17
|
9
|
+
### Added
|
10
|
+
- Add new options `--dump-json` to dump json response on failure when enable. default: false (@jplindquist)
|
11
|
+
- Add new `--pretty` option for pretty format json response when `--dump-json` is enabled. default: false (@jplindquist)
|
12
|
+
|
8
13
|
## [2.7.0] - 2018-02-15
|
9
14
|
### Added
|
10
15
|
- `check-http`: Added ability to use username and password in proxy url (@mclarkson)
|
@@ -158,7 +163,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
158
163
|
### Added
|
159
164
|
- Initial release
|
160
165
|
|
161
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.
|
166
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.0...HEAD
|
167
|
+
[2.8.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.7.0...2.8.0
|
162
168
|
[2.7.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.6.0...2.7.0
|
163
169
|
[2.6.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.5.0...2.6.0
|
164
170
|
[2.5.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.4.0...2.5.0
|
data/bin/check-http-json.rb
CHANGED
@@ -65,6 +65,8 @@ class CheckJson < Sensu::Plugin::Check::CLI
|
|
65
65
|
option :valueGt, long: '--value-greater-than VALUE'
|
66
66
|
option :valueLt, long: '--value-less-than VALUE'
|
67
67
|
option :whole_response, short: '-w', long: '--whole-response', boolean: true, default: false
|
68
|
+
option :dump_json, short: '-d', long: '--dump-json', boolean: true, default: false
|
69
|
+
option :pretty, long: '--pretty', boolean: true, default: false
|
68
70
|
|
69
71
|
def run
|
70
72
|
if config[:url]
|
@@ -188,20 +190,26 @@ class CheckJson < Sensu::Plugin::Check::CLI
|
|
188
190
|
message = "key has expected value: '#{config[:key]}' "
|
189
191
|
if config[:value]
|
190
192
|
raise "unexpected value for key: '#{leaf}' != '#{config[:value]}'" unless leaf.to_s == config[:value].to_s
|
191
|
-
message += "
|
193
|
+
message += "equals '#{config[:value]}'"
|
192
194
|
end
|
193
195
|
if config[:valueGt]
|
194
196
|
raise "unexpected value for key: '#{leaf}' not > '#{config[:valueGt]}'" unless leaf.to_f > config[:valueGt].to_f
|
195
|
-
message += "
|
197
|
+
message += "greater than '#{config[:valueGt]}'"
|
196
198
|
end
|
197
199
|
if config[:valueLt]
|
198
200
|
raise "unexpected value for key: '#{leaf}' not < '#{config[:valueLt]}'" unless leaf.to_f < config[:valueLt].to_f
|
199
|
-
message += "
|
201
|
+
message += "less than '#{config[:valueLt]}'"
|
200
202
|
end
|
201
203
|
|
202
204
|
ok message
|
203
205
|
rescue => e
|
204
|
-
|
206
|
+
if config[:dump_json]
|
207
|
+
json_response = config[:pretty] ? JSON.pretty_generate(json) : json
|
208
|
+
message = "key check failed: #{e}. Response: #{json_response}"
|
209
|
+
else
|
210
|
+
message = "key check failed: #{e}"
|
211
|
+
end
|
212
|
+
critical message
|
205
213
|
end
|
206
214
|
end
|
207
215
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.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-
|
11
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -94,6 +94,26 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mixlib-shellout
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "<"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.3.0
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '2.2'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "<"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: 2.3.0
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.2'
|
97
117
|
- !ruby/object:Gem::Dependency
|
98
118
|
name: pry
|
99
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +204,14 @@ dependencies:
|
|
184
204
|
requirements:
|
185
205
|
- - "~>"
|
186
206
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
207
|
+
version: 1.16.0
|
188
208
|
type: :development
|
189
209
|
prerelease: false
|
190
210
|
version_requirements: !ruby/object:Gem::Requirement
|
191
211
|
requirements:
|
192
212
|
- - "~>"
|
193
213
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
214
|
+
version: 1.16.0
|
195
215
|
- !ruby/object:Gem::Dependency
|
196
216
|
name: kitchen-vagrant
|
197
217
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,20 +240,6 @@ dependencies:
|
|
220
240
|
- - "~>"
|
221
241
|
- !ruby/object:Gem::Version
|
222
242
|
version: '0.3'
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: mixlib-shellout
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - "~>"
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: 2.2.7
|
230
|
-
type: :development
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - "~>"
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: 2.2.7
|
237
243
|
- !ruby/object:Gem::Dependency
|
238
244
|
name: json
|
239
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -309,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
315
|
version: '0'
|
310
316
|
requirements: []
|
311
317
|
rubyforge_project:
|
312
|
-
rubygems_version: 2.7.
|
318
|
+
rubygems_version: 2.7.6
|
313
319
|
signing_key:
|
314
320
|
specification_version: 4
|
315
321
|
summary: Sensu plugins for various http monitors and metrics
|