sensu-plugins-slack 3.1.0 → 3.1.1
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 +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/handler-slack.rb +21 -2
- data/lib/sensu-plugins-slack/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecab2f4ba5c55e4d5c172623e63fe152bf2dc4174ec4ee96e1abfd61bf18826a
|
4
|
+
data.tar.gz: 4b2a25d455aea5fcf91559f8e116dbe23022927cc378936f27aba44a9492cbca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 239b35324f6def0af3b30de9c392be603c1e2bc7528945b70bb9db56897d5be2198d7839a73d7dfece7dacbccc2c0fde50b89ac44fdf1b1e99fa7d367c97c501
|
7
|
+
data.tar.gz: cbca86c11a4416df320b1b1f98543c1afde924045d4b74d8818a97f28e09732ab3e5c0d8c4f67f2668b803d9a5ccf95419866a53f28a03e9d7ea1e2c4f98a1e9
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [3.1.1] - 2018-03-17
|
9
|
+
### Fixed
|
10
|
+
- handler-slack.rb: rescue any non sensu specification compliant status code passed to the slack handler as the color matching unknown (@majormoses)
|
11
|
+
|
8
12
|
## [3.1.0] - 2018-01-31
|
9
13
|
### Changed
|
10
14
|
- `handler-slack.rb`: emit an `unknown` with helpful debug messages when passing in bad config (@majormoses)
|
@@ -122,7 +126,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
122
126
|
### Added
|
123
127
|
- initial release
|
124
128
|
|
125
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/3.1.
|
129
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/3.1.1...HEAD
|
130
|
+
[3.1.1]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/3.1.0...3.1.1
|
126
131
|
[3.1.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/3.0.0...3.1.0
|
127
132
|
[3.0.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/2.0.0...3.0.0
|
128
133
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.5.0...2.0.0
|
data/bin/handler-slack.rb
CHANGED
@@ -210,7 +210,21 @@ class Slack < Sensu::Handler
|
|
210
210
|
2 => '#FF0000',
|
211
211
|
3 => '#6600CC'
|
212
212
|
}
|
213
|
-
|
213
|
+
begin
|
214
|
+
color.fetch(check_status.to_i)
|
215
|
+
# a script can return any error code it feels like we should not assume
|
216
|
+
# that it will always be 0,1,2,3 even if that is the sensu (nagions)
|
217
|
+
# specification. A couple common examples:
|
218
|
+
# 1. A sensu server schedules a check on the instance but the command
|
219
|
+
# executed does not exist in your `$PATH`. Shells will return a `127` status
|
220
|
+
# code.
|
221
|
+
# 2. Similarly a `126` is a permission denied or the command is not
|
222
|
+
# executable.
|
223
|
+
# Rather than adding every possible value we should just treat any non spec
|
224
|
+
# designated status code as `unknown`s.
|
225
|
+
rescue KeyError
|
226
|
+
color.fetch(3)
|
227
|
+
end
|
214
228
|
end
|
215
229
|
|
216
230
|
def check_status
|
@@ -224,6 +238,11 @@ class Slack < Sensu::Handler
|
|
224
238
|
2 => :CRITICAL,
|
225
239
|
3 => :UNKNOWN
|
226
240
|
}
|
227
|
-
|
241
|
+
begin
|
242
|
+
status.fetch(check_status.to_i)
|
243
|
+
# handle any non standard check status as `unknown`
|
244
|
+
rescue KeyError
|
245
|
+
status.fetch(3)
|
246
|
+
end
|
228
247
|
end
|
229
248
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.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: 2018-
|
11
|
+
date: 2018-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 2.7.
|
208
|
+
rubygems_version: 2.7.6
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: Sensu plugins for interfacing with Slack chat
|