sensu-plugins-http 5.0.0 → 5.1.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: a9a64362b7bb7f0d7360ffd6b63d39858bdafafc801e60eaedfeb69efc864662
4
- data.tar.gz: 870ef5758fb885a1fc88984c2fad94651d7e8824ec891692f133a71320faa9e7
3
+ metadata.gz: 2af4e6fd8cd18a7985667f12d1b92e95220626fe93d7f4e30df5c98cd2d21fca
4
+ data.tar.gz: 772256bc9710bf634682aa4909f5f10b29e3fd07b9237dcb8ab61bc66fe85c21
5
5
  SHA512:
6
- metadata.gz: a9f4cd69bb0b5a1457d7ee4521d8ce0453ea3b5821b21c5b7b679760be470a55188002c9d9db6dee57115357dc040f3657a12f6898e97f8f974df19cc77ffe11
7
- data.tar.gz: 6ad523d9d42a06262945ef2b0317424135c00b78e6a3d2c83c4ff91b3a52d59c5a1f95c74c319e2e0937d94f0cd15b8739f371d6fb8808b074cf35ec77518e7a
6
+ metadata.gz: fdf3bbd67f93c1a9a640832cc251bc18224c411eae29cba465ae2abb516405258694e73ede7f3407be55c365bbb0dbbcc780433e07a9dcc2b78a1d079a4d0fbf
7
+ data.tar.gz: 1461ab44a224cbeb8d4d6b72565bf04b0197207ff1b50bbed9b6f747c4b05729cbd2366f6680bd0b7fc81c3414c45fadaaab433b6c27b808aec8354097420aa5
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
+ ## [5.1.0] - 2019-05-06
9
+ ### Added
10
+ metrics-http-json.rb: Added the option to disable ssl cert verification
11
+ metrics-http-json.rb: Added debug option to see the processing of json data
12
+
8
13
  ## [5.0.0] - 2019-04-18
9
14
  ### Breaking Changes
10
15
  - Bump `sensu-plugin` dependency from `~> 3.0` to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17)
@@ -234,7 +239,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
234
239
  ### Added
235
240
  - Initial release
236
241
 
237
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/5.0.0...HEAD
242
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/5.1.0...HEAD
243
+ [5.1.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/5.0.0...5.1.0
238
244
  [5.0.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/4.1.0...5.0.0
239
245
  [4.1.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/4.0.0...4.1.0
240
246
  [4.0.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/3.0.1...4.0.0
@@ -65,7 +65,21 @@ class HttpJsonGraphite < Sensu::Plugin::Metric::CLI::Graphite
65
65
  short: '-o OBJECT',
66
66
  long: '--object OBJECT'
67
67
 
68
+ option :insecure,
69
+ description: 'By default, every SSL connection made is verified to be secure. This option allows you to disable the verification',
70
+ short: '-k',
71
+ long: '--insecure',
72
+ boolean: true,
73
+ default: false
74
+
75
+ option :debug,
76
+ short: '-d',
77
+ long: '--debug',
78
+ default: false
79
+
68
80
  def run
81
+ puts "args config: #{config}" if config[:debug]
82
+
69
83
  scheme = config[:scheme].to_s
70
84
  metric_pair_input = config[:metric].to_s
71
85
  if config[:object]
@@ -74,10 +88,17 @@ class HttpJsonGraphite < Sensu::Plugin::Metric::CLI::Graphite
74
88
  # TODO: figure out what to do here
75
89
  url = URI.encode(config[:url].to_s) # rubocop:disable Lint/UriEscapeUnescape
76
90
  begin
77
- r = RestClient.get url
91
+ r = RestClient::Request.execute(
92
+ url: url,
93
+ method: :get,
94
+ verify_ssl: !config[:insecure]
95
+ )
96
+
97
+ puts "Http response: #{r}" if config[:debug]
78
98
  metric_pair_array = metric_pair_input.split(/,/)
79
99
  metric_pair_array.each do |m|
80
100
  metric, attribute = m.to_s.split(/::/)
101
+ puts "metric: #{metric}, attribute: #{attribute}" if config[:debug]
81
102
  unless object.nil?
82
103
  JSON.parse(r)[object].each do |k, v|
83
104
  if k == attribute
@@ -3,7 +3,7 @@
3
3
  module SensuPluginsHttp
4
4
  module Version
5
5
  MAJOR = 5
6
- MINOR = 0
6
+ MINOR = 1
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: 5.0.0
4
+ version: 5.1.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: 2019-04-19 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin