sensu-plugins-http 2.8.4 → 2.9.0

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
  SHA256:
3
- metadata.gz: 579450eb89fa17729387bb3c7a893a0a4012aed0853b63c75c77b8e835316fc0
4
- data.tar.gz: 47a56f8c8928ac44f27ee71bda6e42ea12fd3ee2c49bc463a0b1b2d0ba5da1b2
3
+ metadata.gz: 9c1ad8fa12d72b4c1d5066f479d1aa256c8c8eae21f8a151662d75952ede6aee
4
+ data.tar.gz: fe2f4cd9cc094b5f392b70147d8c78f711f2260d5963a12aeb4b4fd0642dbd76
5
5
  SHA512:
6
- metadata.gz: ccf5a9ed5a3d823b6ac99bc28723e6276e15ce3183f2bf7dc84d6de5538ecad6e90e6e32dee12326acfb2b3b02c1e8373b1850325e8e2285a028f09b2aaa7bfc
7
- data.tar.gz: 5184c932fc589eb30cb6ed6cd746d82fc99fcf9f394580a30045e6833305685fdf274cd607b5eba875bc361049c4bdb0d0326dbe986adaf18495a61290e9f40a
6
+ metadata.gz: 1a1bbe80432676b89d5ae45bac7f213b5ecb4a42780a1c71ed905a9dee9d7a286d84fafa61c3cec9a10c91b591aeaa33ed891428576b69b8e2483e1082b45e82
7
+ data.tar.gz: 7663c32efff7508fc3500f333e05af69981656d8f0bbf6d9038d7c40acd4f8397c06ececdd6ac8386f5b07dd129093343baf7b6822b4a1f5095283ce0fca5322
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
+
9
+ ## [2.9.0] - 2018-05-03
10
+ ### Added
11
+ - `check-http-json.rb`: add option `--post-body` to include a post body (@andy-s-clark)
12
+
8
13
  ## [2.8.4] - 2018-03-27
9
14
  ### Security
10
15
  - updated yard dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 (@majormoses)
@@ -185,7 +190,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
185
190
  ### Added
186
191
  - Initial release
187
192
 
188
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.3...HEAD
193
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.9.0...HEAD
194
+ [2.9.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.4...2.9.0
189
195
  [2.8.4]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.3...2.8.4
190
196
  [2.8.3]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.2...2.8.3
191
197
  [2.8.2]: https://github.com/sensu-plugins/sensu-plugins-http/compare/2.8.1...2.8.2
@@ -28,6 +28,9 @@
28
28
  # greater than 10
29
29
  # ./check-http-json.rb -u http://my.site.com/metric.json --key page.totalElements --value-greater-than 10
30
30
  #
31
+ # Check that will POST json
32
+ # ./check-http-json.rb -u http://my.site.com/metric.json -m POST --header 'Content-type: application/json' --post-body '{"serverId": "myserver"}'
33
+ #
31
34
  # NOTES:
32
35
  # Based on Check HTTP by Sonian Inc.
33
36
  #
@@ -53,6 +56,7 @@ class CheckJson < Sensu::Plugin::Check::CLI
53
56
  option :port, short: '-P PORT', proc: proc(&:to_i)
54
57
  option :method, short: '-m GET|POST'
55
58
  option :postbody, short: '-b /file/with/post/body'
59
+ option :post_body, long: '--post-body VALUE'
56
60
  option :header, short: '-H HEADER', long: '--header HEADER'
57
61
  option :ssl, short: '-s', boolean: true, default: false
58
62
  option :insecure, short: '-k', boolean: true, default: false
@@ -164,6 +168,9 @@ class CheckJson < Sensu::Plugin::Check::CLI
164
168
  post_body = IO.readlines(config[:postbody])
165
169
  req.body = post_body.join
166
170
  end
171
+ if config[:post_body]
172
+ req.body = config[:post_body]
173
+ end
167
174
  unless config[:user].nil? && config[:password].nil?
168
175
  req.basic_auth config[:user], config[:password]
169
176
  end
@@ -3,8 +3,8 @@
3
3
  module SensuPluginsHttp
4
4
  module Version
5
5
  MAJOR = 2
6
- MINOR = 8
7
- PATCH = 4
6
+ MINOR = 9
7
+ PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  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.8.4
4
+ version: 2.9.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-03-27 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin