sensu-plugins-hipchat 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00ae068957af71fde4ac13c09d88b3dad07f8827ee8814ced718fa74a0bddecb
4
- data.tar.gz: 5affcd94f4e1e54eaa9ad2dc3a3c049f17c09f30c4b054ec262f05917db9dd78
3
+ metadata.gz: 28f7c06db45a8e0f4475d7ce284a3d2f2407b9aa95bfa3819dbf8af3731f3951
4
+ data.tar.gz: 7a40380ed615c29632e01e98b0b6b7a3170bba73261c561cd84a2baf97acaa17
5
5
  SHA512:
6
- metadata.gz: 615e662ed41c212e53e1ad1c2a69b63d1c96e0b9e5f67ddd38723659542f550689e119e8e407f45e7ee3fcb50ec2bf95fd5783907c3847a0191e9e550ce06b62
7
- data.tar.gz: 5e3f68be385d448cebe199d0e6b9e04acb49b2ea9b9194ca05f9a632ee1e2f44983ae809811aa24e76b5d9000ef72b06f67035bcb91fcdb1fc4dc486e809d159
6
+ metadata.gz: 02e2ac852e866d06362df2823598212f2985a86b9f503dbcb4897a640d9b6e0d714dd7acc2a579b7e482bfe31ad43a23a36bbaef59066aa184ef22ddef7c16ef
7
+ data.tar.gz: aaa683220c88e30c53505fb34312922a65da9163a009e58702f344bdea2ecf96a93ba5d5fe01cadaa3fbb1c3d02fcc40dec4e4eabe82e84db600074c94c494f0
@@ -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.0.0...HEAD
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
@@ -62,7 +62,8 @@ cat <<EOF | bundle exec bin/handler-hipchat.rb
62
62
  "status": 1,
63
63
  "name": "name",
64
64
  "source": "source",
65
- "output": "Hello, warning"
65
+ "output": "Hello, warning",
66
+ "hipchat_room": ["general","important"]
66
67
  }
67
68
  }
68
69
  EOF
@@ -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
- room = @event['client']['hipchat_room'] || @event['check']['hipchat_room'] || settings[json_config]['room']
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
- hipchatmsg[room].send(from, message, color: 'green', message_format: message_format)
91
+ rooms.each do |room|
92
+ hipchatmsg[room].send(from, message, color: 'green', message_format: message_format)
93
+ end
89
94
  else
90
- hipchatmsg[room].send(from, message, color: @event['check']['status'] == 1 ? 'yellow' : 'red', notify: true, message_format: message_format)
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 #{room}"
101
+ puts "hipchat -- timed out while attempting to message #{rooms.join(', ')}"
95
102
  end
96
103
  end
97
104
  end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsHipchat
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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.0.0
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: 2017-12-08 00:00:00.000000000 Z
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.3
220
+ rubygems_version: 2.7.7
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Sensu plugins for hipchat