sensu-plugins-http 5.0.0 → 5.1.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/metrics-http-json.rb +22 -1
- 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: 2af4e6fd8cd18a7985667f12d1b92e95220626fe93d7f4e30df5c98cd2d21fca
|
4
|
+
data.tar.gz: 772256bc9710bf634682aa4909f5f10b29e3fd07b9237dcb8ab61bc66fe85c21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/bin/metrics-http-json.rb
CHANGED
@@ -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.
|
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
|
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.
|
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-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|