sensu-plugins-http 2.9.0 → 2.10.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
  SHA256:
3
- metadata.gz: 9c1ad8fa12d72b4c1d5066f479d1aa256c8c8eae21f8a151662d75952ede6aee
4
- data.tar.gz: fe2f4cd9cc094b5f392b70147d8c78f711f2260d5963a12aeb4b4fd0642dbd76
3
+ metadata.gz: f7ad8cff5dc35071f986cfa1045f3975c8ffbddfc85df368913c9ec5c69519ec
4
+ data.tar.gz: 3eb9c03bed43c24a5087041169fc76dc06251d0e5a11a7a5ac401a8296462a3a
5
5
  SHA512:
6
- metadata.gz: 1a1bbe80432676b89d5ae45bac7f213b5ecb4a42780a1c71ed905a9dee9d7a286d84fafa61c3cec9a10c91b591aeaa33ed891428576b69b8e2483e1082b45e82
7
- data.tar.gz: 7663c32efff7508fc3500f333e05af69981656d8f0bbf6d9038d7c40acd4f8397c06ececdd6ac8386f5b07dd129093343baf7b6822b4a1f5095283ce0fca5322
6
+ metadata.gz: 07956574d712f483e036d5ceecf2d1ac13d4557467ea63e2a799b9814febd9b40bf0f12810ce0c4db02e13fd7cc9f2897536bb2e9eb0b5cad09f6973975db046
7
+ data.tar.gz: 2b2d8c0a3e995aee4bcec18caff9d8eed00885b2f48277f5757731252a7009c65ffaa8f8c7e89eb1562a09854f3cee2b7bdce9a90d6c6b94e17a95cb433b11ba
data/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.10.0] - 2018-05-23
9
+ ### Added
10
+ - `check-http.rb`: add option `--min-bytes` to check if a response is greater than minimum specified value (@lisfo4ka)
8
11
 
9
12
  ## [2.9.0] - 2018-05-03
10
13
  ### Added
@@ -190,7 +193,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
190
193
  ### Added
191
194
  - Initial release
192
195
 
193
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.9.0...HEAD
196
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.10.0...HEAD
197
+ [2.10.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.9.0...2.10.0
194
198
  [2.9.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.4...2.9.0
195
199
  [2.8.4]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.3...2.8.4
196
200
  [2.8.3]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.2...2.8.3
data/bin/check-http.rb CHANGED
@@ -24,6 +24,9 @@
24
24
  # Pattern check - expect a 200 response and the string 'OK' in the body
25
25
  # check-http.rb -u http://my.site.com/health -q 'OK'
26
26
  #
27
+ # Check if a response is greater than the specified minimum value
28
+ # check-http.rb -u https://my.site.com/redirect --min-bytes 10
29
+ #
27
30
  # Check response code - expect a 301 response
28
31
  # check-http.rb -u https://my.site.com/redirect --response-code 301 -r
29
32
  #
@@ -195,6 +198,12 @@ class CheckHttp < Sensu::Plugin::Check::CLI
195
198
  description: 'Check the response contains exactly BYTES bytes',
196
199
  proc: proc(&:to_i)
197
200
 
201
+ option :min_bytes,
202
+ short: '-g BYTES',
203
+ long: '--min-bytes BYTES',
204
+ description: 'Check the response contains at least BYTES bytes',
205
+ proc: proc(&:to_i)
206
+
198
207
  option :response_code,
199
208
  long: '--response-code CODE',
200
209
  description: 'Check for a specific response code'
@@ -338,6 +347,10 @@ class CheckHttp < Sensu::Plugin::Check::CLI
338
347
  critical "Response was #{res.body.length} bytes instead of #{config[:require_bytes]}" + body
339
348
  end
340
349
 
350
+ if config[:min_bytes] && res.body.length < config[:min_bytes]
351
+ critical "Response was #{res.body.length} bytes instead of the indicated minimum #{config[:min_bytes]}" + body
352
+ end
353
+
341
354
  unless warn_cert_expire.nil?
342
355
  warning "Certificate will expire #{warn_cert_expire}"
343
356
  end
@@ -3,7 +3,7 @@
3
3
  module SensuPluginsHttp
4
4
  module Version
5
5
  MAJOR = 2
6
- MINOR = 9
6
+ MINOR = 10
7
7
  PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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.9.0
4
+ version: 2.10.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-03 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  version: '0'
330
330
  requirements: []
331
331
  rubyforge_project:
332
- rubygems_version: 2.7.6
332
+ rubygems_version: 2.7.7
333
333
  signing_key:
334
334
  specification_version: 4
335
335
  summary: Sensu plugins for various http monitors and metrics