sensu-plugins-http 2.10.0 → 2.11.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 +6 -1
- data/bin/check-http.rb +3 -3
- data/lib/sensu-plugins-http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee65bed5670246b5af15d48460ed5cd47f08190ea3cb84be81e1a29baf468815
|
4
|
+
data.tar.gz: 2581a8b459e0554cdb6939716dec864b0c60ffbdfcb2d0f8fe7b6b6ce3f79253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc5dfdcf0417dbea0ad6c9a34c9a0f6529489888e85761b8ec586da75c3b1f789b29a3cccfe87ae25fd2c70b68ab6631e395ca75dd6a5293e0788034f6362fc
|
7
|
+
data.tar.gz: 603dcac8c82f736761c387a1a646ae5393ac0a66a940519ba6c9863525e6d36a1c1c18d0aed62fabe126b5d3d5761be5a0d75d566f6ff6777a8ea4e550d69910
|
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.11.0] - 2018-06-04
|
9
|
+
### Added
|
10
|
+
- `check-http-json.rb`: add option `--response-code` for checking the HTTP response code
|
11
|
+
- `check-http.rb`: modify option `--response-code` to accept a regex
|
12
|
+
|
8
13
|
## [2.10.0] - 2018-05-23
|
9
14
|
### Added
|
10
15
|
- `check-http.rb`: add option `--min-bytes` to check if a response is greater than minimum specified value (@lisfo4ka)
|
@@ -193,7 +198,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
193
198
|
### Added
|
194
199
|
- Initial release
|
195
200
|
|
196
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.
|
201
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.11.0...HEAD
|
202
|
+
[2.11.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.10.0...2.11.0
|
197
203
|
[2.10.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.9.0...2.10.0
|
198
204
|
[2.9.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.4...2.9.0
|
199
205
|
[2.8.4]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.3...2.8.4
|
data/bin/check-http-json.rb
CHANGED
@@ -74,6 +74,11 @@ class CheckJson < Sensu::Plugin::Check::CLI
|
|
74
74
|
option :dump_json, short: '-d', long: '--dump-json', boolean: true, default: false
|
75
75
|
option :pretty, long: '--pretty', boolean: true, default: false
|
76
76
|
|
77
|
+
option :response_code,
|
78
|
+
long: '--response-code REGEX',
|
79
|
+
description: 'Critical if HTTP response code does not match REGEX',
|
80
|
+
default: '^2([0-9]{2})$'
|
81
|
+
|
77
82
|
def run
|
78
83
|
if config[:url]
|
79
84
|
uri = URI.parse(config[:url])
|
@@ -182,7 +187,7 @@ class CheckJson < Sensu::Plugin::Check::CLI
|
|
182
187
|
end
|
183
188
|
res = http.request(req)
|
184
189
|
|
185
|
-
|
190
|
+
if res.code !~ /#{config[:response_code]}/
|
186
191
|
critical "http code: #{res.code}: body: #{res.body}" if config[:whole_response]
|
187
192
|
critical res.code
|
188
193
|
end
|
data/bin/check-http.rb
CHANGED
@@ -205,8 +205,8 @@ class CheckHttp < Sensu::Plugin::Check::CLI
|
|
205
205
|
proc: proc(&:to_i)
|
206
206
|
|
207
207
|
option :response_code,
|
208
|
-
long: '--response-code
|
209
|
-
description: '
|
208
|
+
long: '--response-code REGEX',
|
209
|
+
description: 'Critical if HTTP response code does not match REGEX'
|
210
210
|
|
211
211
|
option :proxy_url,
|
212
212
|
long: '--proxy-url PROXY_URL',
|
@@ -408,7 +408,7 @@ class CheckHttp < Sensu::Plugin::Check::CLI
|
|
408
408
|
warning(res.code + body) unless config[:response_code]
|
409
409
|
end
|
410
410
|
|
411
|
-
if config[:response_code] && config[:response_code]
|
411
|
+
if config[:response_code] && res.code =~ /#{config[:response_code]}/
|
412
412
|
ok "#{res.code}, #{size} bytes" + body
|
413
413
|
|
414
414
|
else
|
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.11.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-05
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|