sensu-plugins-hipchat 3.0.0 → 3.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 +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +2 -1
- data/bin/handler-hipchat.rb +11 -4
- data/lib/sensu-plugins-hipchat/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: 28f7c06db45a8e0f4475d7ce284a3d2f2407b9aa95bfa3819dbf8af3731f3951
|
|
4
|
+
data.tar.gz: 7a40380ed615c29632e01e98b0b6b7a3170bba73261c561cd84a2baf97acaa17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02e2ac852e866d06362df2823598212f2985a86b9f503dbcb4897a640d9b6e0d714dd7acc2a579b7e482bfe31ad43a23a36bbaef59066aa184ef22ddef7c16ef
|
|
7
|
+
data.tar.gz: aaa683220c88e30c53505fb34312922a65da9163a009e58702f344bdea2ecf96a93ba5d5fe01cadaa3fbb1c3d02fcc40dec4e4eabe82e84db600074c94c494f0
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [3.1.0] - 2018-09-03
|
|
9
|
+
### Added
|
|
10
|
+
- support list of hipchat rooms, so notifications are sent to multiple rooms (@cgarciaarano)
|
|
11
|
+
|
|
8
12
|
## [3.0.0] - 2017-12-07
|
|
9
13
|
### Breaking Changes
|
|
10
14
|
- bumped dependency of `sensu-plugin` to 2.x you can read about it [here](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29) (@multani)
|
|
@@ -53,7 +57,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
|
53
57
|
### Added
|
|
54
58
|
- initial release
|
|
55
59
|
|
|
56
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/3.
|
|
60
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/3.1.0...HEAD
|
|
61
|
+
[3.1.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/3.0.0...3.1.0
|
|
57
62
|
[3.0.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/2.1.0...3.0.0
|
|
58
63
|
[2.1.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/2.0.0...2.1.0
|
|
59
64
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/1.0.0...2.0.0
|
data/README.md
CHANGED
data/bin/handler-hipchat.rb
CHANGED
|
@@ -45,7 +45,7 @@ class HipChatNotif < Sensu::Handler
|
|
|
45
45
|
apiversion = settings[json_config]['apiversion'] || 'v1'
|
|
46
46
|
proxy_url = settings[json_config]['proxy_url']
|
|
47
47
|
hipchatmsg = HipChat::Client.new(settings[json_config]['apikey'], api_version: apiversion, http_proxy: proxy_url, server_url: server_url)
|
|
48
|
-
|
|
48
|
+
rooms = @event['client']['hipchat_room'] || @event['check']['hipchat_room'] || settings[json_config]['room']
|
|
49
49
|
from = settings[json_config]['from'] || 'Sensu'
|
|
50
50
|
message_template = settings[json_config]['message_template']
|
|
51
51
|
message_format = settings[json_config]['message_format'] || 'html'
|
|
@@ -84,14 +84,21 @@ class HipChatNotif < Sensu::Handler
|
|
|
84
84
|
|
|
85
85
|
begin
|
|
86
86
|
Timeout.timeout(3) do
|
|
87
|
+
unless rooms.is_a?(Array)
|
|
88
|
+
rooms = [rooms]
|
|
89
|
+
end
|
|
87
90
|
if @event['action'].eql?('resolve')
|
|
88
|
-
|
|
91
|
+
rooms.each do |room|
|
|
92
|
+
hipchatmsg[room].send(from, message, color: 'green', message_format: message_format)
|
|
93
|
+
end
|
|
89
94
|
else
|
|
90
|
-
|
|
95
|
+
rooms.each do |room|
|
|
96
|
+
hipchatmsg[room].send(from, message, color: @event['check']['status'] == 1 ? 'yellow' : 'red', notify: true, message_format: message_format)
|
|
97
|
+
end
|
|
91
98
|
end
|
|
92
99
|
end
|
|
93
100
|
rescue Timeout::Error
|
|
94
|
-
puts "hipchat -- timed out while attempting to message #{
|
|
101
|
+
puts "hipchat -- timed out while attempting to message #{rooms.join(', ')}"
|
|
95
102
|
end
|
|
96
103
|
end
|
|
97
104
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sensu-plugins-hipchat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.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:
|
|
11
|
+
date: 2018-09-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hipchat
|
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
217
217
|
version: '0'
|
|
218
218
|
requirements: []
|
|
219
219
|
rubyforge_project:
|
|
220
|
-
rubygems_version: 2.7.
|
|
220
|
+
rubygems_version: 2.7.7
|
|
221
221
|
signing_key:
|
|
222
222
|
specification_version: 4
|
|
223
223
|
summary: Sensu plugins for hipchat
|