sensu-plugins-sensu 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +9 -1
- data/bin/handler-sensu.rb +13 -1
- data/lib/sensu-plugins-sensu/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f7a6f59e123f564d0fa00fd5b58a3c8e3a559e33f229a7e1d67acf7385bbe0fa
|
4
|
+
data.tar.gz: a1ea1deef5b7202d7f14e2ed1f27184dffba0a45ddf9112dc3b13451cc7f651d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e5df05bc2315148cf07e5e561a91d0c910aaf3d764f6208e8d663aa2248b3271678866e5da478a6187d3e8857c250092bb4095f2c022bf283e389ecc5d49f19
|
7
|
+
data.tar.gz: abcd67c206dc5cb1dd3c7aa544a525378c240f663c55e23b5e089b937d23430facf147d5f5db8c3267a3c875509090e0f13dcb152edc155f6cc2d3a67f74f624
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.4.1] - 2018-01-23
|
10
|
+
### Fixed
|
11
|
+
- Removed brackets that were added around `subscribers` in the `trigger_remediation` method in #15. This resulted in a successful submission with an HTTP 202, however as this resulted in the subscribers key being an array of arrays which meant that the remediation never was actually scheduled. This fixes it by doing a couple of things, first we remove the extra brackets therefore solving the problem. That being said I decided to add some additional validation of the data to ensure that minimally what is being passed in is an array and the first element is a string, if that is not the case we either error out when unable to determine a fix with a helpful message or in the case of nested arrays attempt to flatten them. (@drhey) (@majormoses)
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- updated changelog guidelines location (@majormoses)
|
15
|
+
|
9
16
|
## [2.4.0] - 2017-10-12
|
10
17
|
### Added
|
11
18
|
- `--debug` Option to display results hash at end of output message.
|
@@ -105,7 +112,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
105
112
|
### Added
|
106
113
|
- initial release
|
107
114
|
|
108
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.
|
115
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.4.1...HEAD
|
116
|
+
[2.4.1]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.4.0...2.4.1
|
109
117
|
[2.4.0]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.3.1...2.4.0
|
110
118
|
[2.3.1]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.3.0...2.3.1
|
111
119
|
[2.3.0]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/2.2.2...2.3.0
|
data/bin/handler-sensu.rb
CHANGED
@@ -132,8 +132,20 @@ class Remediator < Sensu::Handler
|
|
132
132
|
|
133
133
|
# Issue a check via the API
|
134
134
|
def trigger_remediation(check, subscribers)
|
135
|
+
if subscribers.class != Array
|
136
|
+
p "subscribers: #{subscribers} must be an array"
|
137
|
+
exit 3
|
138
|
+
elsif subscribers.first.class == Array
|
139
|
+
subscribers.flatten
|
140
|
+
p "subscribers: #{subscribers} must be a flat array of strings, we auto flattened: #{subscribers}"
|
141
|
+
end
|
135
142
|
api_request(:POST, '/request') do |req|
|
136
|
-
req.body = JSON.dump(
|
143
|
+
req.body = JSON.dump(
|
144
|
+
'check' => check,
|
145
|
+
'subscribers' => subscribers,
|
146
|
+
'creator' => 'sensu-plugins-sensu',
|
147
|
+
'reason' => 'Auto remediation triggered'
|
148
|
+
)
|
137
149
|
end
|
138
150
|
end
|
139
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
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:
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 2.
|
234
|
+
rubygems_version: 2.7.4
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Sensu plugins for sensu
|