sensu-plugins-hipchat 3.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -2
- data/bin/handler-hipchat.rb +18 -16
- data/lib/sensu-plugins-hipchat.rb +2 -0
- data/lib/sensu-plugins-hipchat/version.rb +4 -2
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80bc59dfabd1b0103038cf59665f9a40d041b24f8892dc4f5f2658fbfc841efc
|
4
|
+
data.tar.gz: 43872ce4189ba5a41a6dcfa0970b800c3f3b0df51e6e068c89a4adc72f005ba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6838784febad7196ff870a15e3f82c4c567d660c2fdcdbe638c55f90d8d8de88419035e601972431c0e983783e388f5906c11cd23eecea3d407e28d332583043
|
7
|
+
data.tar.gz: 47f7b8d14dbf2c99054df212e19b34e41f177a2b1af8c384240a2a21d38f8e55258b7a87051804e21e0d8d48788a4e023eafb59687f2b4142bf02c32d937513d
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
-
This CHANGELOG follows the format
|
4
|
+
This CHANGELOG follows the format laid out [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [4.0.0] - 2018-09-09
|
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 support for `< 2.3` (@majormoses)
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- appeased the cops (@majormoses)
|
18
|
+
- bumped min `sensu-plugin` to the latest version of 2.x (@majormoses)
|
19
|
+
- update changelog guidelines location (@majormoses)
|
20
|
+
|
8
21
|
## [3.1.0] - 2018-09-03
|
9
22
|
### Added
|
10
23
|
- support list of hipchat rooms, so notifications are sent to multiple rooms (@cgarciaarano)
|
@@ -57,7 +70,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
57
70
|
### Added
|
58
71
|
- initial release
|
59
72
|
|
60
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/
|
73
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/4.0.0...HEAD
|
74
|
+
[4.0.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/3.1.0...4.0.0
|
61
75
|
[3.1.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/3.0.0...3.1.0
|
62
76
|
[3.0.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/2.1.0...3.0.0
|
63
77
|
[2.1.0]: https://github.com/sensu-plugins/sensu-plugins-hipchat/compare/2.0.0...2.1.0
|
data/bin/handler-hipchat.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# Sensu Handler: hipchat
|
4
6
|
#
|
@@ -52,33 +54,33 @@ class HipChatNotif < Sensu::Handler
|
|
52
54
|
|
53
55
|
# If the playbook attribute exists and is a URL, "[<a href='url'>playbook</a>]" will be output.
|
54
56
|
# To control the link name, set the playbook value to the HTML output you would like.
|
55
|
-
playbook = ''
|
57
|
+
playbook = +'' # unary operator for unfrozen string literal
|
56
58
|
if @event['check']['playbook']
|
57
59
|
begin
|
58
60
|
uri = URI.parse(@event['check']['playbook'])
|
59
|
-
playbook << if %w
|
61
|
+
playbook << if %w[http https].include?(uri.scheme)
|
60
62
|
" [<a href='#{@event['check']['playbook']}'>Playbook</a>]"
|
61
63
|
else
|
62
64
|
" Playbook: #{@event['check']['playbook']}"
|
63
65
|
end
|
64
|
-
rescue
|
66
|
+
rescue StandardError
|
65
67
|
playbook << " Playbook: #{@event['check']['playbook']}"
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
69
|
-
if message_template && File.readable?(message_template)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
template = if message_template && File.readable?(message_template)
|
72
|
+
File.read(message_template)
|
73
|
+
else
|
74
|
+
'''<%=
|
75
|
+
[
|
76
|
+
@event["action"].eql?("resolve") ? "RESOLVED" : "ALERT",
|
77
|
+
" - [#{event_name}] - ",
|
78
|
+
@event["check"]["notification"] || @event["check"]["output"],
|
79
|
+
playbook,
|
80
|
+
"."
|
81
|
+
].join
|
82
|
+
%>'''
|
83
|
+
end
|
82
84
|
eruby = Erubis::Eruby.new(template)
|
83
85
|
message = eruby.result(binding)
|
84
86
|
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-hipchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: erubis
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: hipchat
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.5.1
|
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: 1.5.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: sensu-plugin
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: '2.5'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
54
|
+
version: '2.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,47 +137,47 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3.2'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rspec
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '3.4'
|
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: '3.4'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: rubocop
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 0.51.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 0.51.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: yard
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 0.9.11
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 0.9.11
|
181
181
|
description: Sensu plugins for hipchat
|
182
182
|
email: "<sensu-users@googlegroups.com>"
|
183
183
|
executables:
|
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
209
|
requirements:
|
210
210
|
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
|
-
version: 2.
|
212
|
+
version: 2.3.0
|
213
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
214
|
requirements:
|
215
215
|
- - ">="
|