sensu-plugins-microsoft-teams 1.3.1 → 2.0.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 +4 -4
- data/CHANGELOG.md +17 -1
- data/bin/handler-microsoft-teams.rb +22 -2
- data/lib/sensu-plugins-microsoft-teams.rb +2 -0
- data/lib/sensu-plugins-microsoft-teams/version.rb +5 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 541d1853503db9c80c64c029919579bae2348c99daf04c9a791a99117d9a8c80
|
4
|
+
data.tar.gz: 7f4e1ec3baa89aad3a4907b2548d00fdc81118adcd62ba5ee6fc1f2178022818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01508752368d3d228bd6146f82122aded13e1a13eb6c107bb8d4d100c695d223c70f2c45eb591dc95fc49acda34bf01d4e999240d50bb82d04fab19d8407242c
|
7
|
+
data.tar.gz: 101347e9de53a19d93800a7a76172c1cb9f46dd2bae01e0dee6135fff71a4c2172fad7d1cb97de28967f2b4f33ae570ce3db5904f4dc77aaa782ae9f48b4efa2
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,21 @@ This CHANGELOG follows the format located [here](https://github.com/sensu-plugin
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.0] - 2018-09-15
|
9
|
+
### Security
|
10
|
+
- updated `yard` dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 which closes attacks against a yard server loading arbitrary files (@majormoses)
|
11
|
+
- updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
|
12
|
+
|
13
|
+
### Breaking Changes
|
14
|
+
- removed ruby versions `< 2.3` support (@majormoses)
|
15
|
+
- bumped `sensu-plugin` to `~> 2.7` which removes in handler event filtering you can read about it [here](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v145---2017-03-07)(@majormoses)
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
- fix `handler-microsoft-teams.rb`: rescue any non sensu specification compliant status code passed to the microsoft-teams handler as the color matching `unknown` (@majormoses)
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
- appeased the cops (@majormoses)
|
22
|
+
|
8
23
|
## [1.3.1] - 2018-09-12
|
9
24
|
### Fixed
|
10
25
|
- Add erubis gem as a startup dependency (@asachs01)
|
@@ -70,7 +85,8 @@ This CHANGELOG follows the format located [here](https://github.com/sensu-plugin
|
|
70
85
|
- updated references of `skel` to `microsoft-teams` (@tuxpower)
|
71
86
|
|
72
87
|
|
73
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/
|
88
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/2.0.0...HEAD
|
89
|
+
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/1.3.1...2.0.0
|
74
90
|
[1.3.1]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/1.3.0...1.3.1
|
75
91
|
[1.3.0]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/v1.2.2...1.3.0
|
76
92
|
[1.2.2]: https://github.com/sensu-plugins/sensu-plugins-microsoft-teams/compare/v1.2.1...v1.2.2
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
# Copyright 2017 Jose Gaspar and contributors.
|
4
5
|
#
|
@@ -199,7 +200,21 @@ class MicrosoftTeams < Sensu::Handler
|
|
199
200
|
2 => '#FF0000',
|
200
201
|
3 => '#6600CC'
|
201
202
|
}
|
202
|
-
|
203
|
+
# a script can return any error code it feels like we should not assume
|
204
|
+
# that it will always be 0,1,2,3 even if that is the sensu (nagions)
|
205
|
+
# specification. A couple common examples:
|
206
|
+
# 1. A sensu server schedules a check on the instance but the command
|
207
|
+
# executed does not exist in your `$PATH`. Shells will return a `127` status
|
208
|
+
# code.
|
209
|
+
# 2. Similarly a `126` is a permission denied or the command is not
|
210
|
+
# executable.
|
211
|
+
# Rather than adding every possible value we should just treat any non spec
|
212
|
+
# designated status code as `unknown`s.
|
213
|
+
begin
|
214
|
+
color.fetch(check_status.to_i)
|
215
|
+
rescue KeyError
|
216
|
+
color.fetch(3)
|
217
|
+
end
|
203
218
|
end
|
204
219
|
|
205
220
|
def check_status
|
@@ -213,6 +228,11 @@ class MicrosoftTeams < Sensu::Handler
|
|
213
228
|
2 => :CRITICAL,
|
214
229
|
3 => :UNKNOWN
|
215
230
|
}
|
216
|
-
|
231
|
+
begin
|
232
|
+
status[check_status.to_i]
|
233
|
+
# handle any non standard check status as `unknown`
|
234
|
+
rescue KeyError
|
235
|
+
status.fetch(3)
|
236
|
+
end
|
217
237
|
end
|
218
238
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-microsoft-teams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.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-09-
|
11
|
+
date: 2018-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 0.9.11
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 0.9.11
|
153
153
|
description: Sensu plugins for interfacing with Microsoft Teams
|
154
154
|
email: "<sensu-users@googlegroups.com>"
|
155
155
|
executables:
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
requirements:
|
182
182
|
- - ">="
|
183
183
|
- !ruby/object:Gem::Version
|
184
|
-
version: 2.
|
184
|
+
version: 2.3.0
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
187
|
- - ">="
|