sensu-plugins-slack 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +3 -3
- data/bin/handler-slack-multichannel.rb +17 -13
- data/bin/handler-slack.rb +13 -13
- data/lib/sensu-plugins-slack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9db07df331e402395365319e4772798ce55f79ba
|
4
|
+
data.tar.gz: 5c44de22dd791ddf483ddcb9b355721cb7cef070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fb4ba744491325b6c151329c95cb727d3bb392044d7c95fd91a745066ba387dd61e84b5c4839bf23d226ca73f2206669e8c95250d25b72d794789391dde230
|
7
|
+
data.tar.gz: 021347360047ba11bc4e35aa86e8c6f32f897dc7a69377a0b97dc008801bc231735280c691ebdb01df773bd26f6a184529a9fb795d98b29bfa3bd062e3609aac
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.1.1] - 2017-06-24
|
9
|
+
### Fixed
|
10
|
+
- Ran rubocop against `bin/slack-handler.rb` and `bin/slack-handler-multichannel.rb` (@pgporada)
|
11
|
+
- Fixed occurrences of http:// needing to be https:// by default (@pgporada)
|
12
|
+
- Fixed the location of the Sensu image that gets pulled in (@pgporada)
|
13
|
+
|
8
14
|
## [1.1.0] - 2017-06-22
|
9
15
|
### Added
|
10
16
|
- `slack-handler-multichannel.rb`: Add title line to mirror functionality of slack-handler.rb (@zer0nimbus)
|
@@ -74,7 +80,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
74
80
|
### Added
|
75
81
|
- initial release
|
76
82
|
|
77
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.
|
83
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.1...HEAD
|
84
|
+
[1.1.1]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.0...1.1.1.
|
78
85
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.0.0...1.1.0
|
79
86
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/v0.1.2...1.0.0
|
80
87
|
[0.1.2]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/0.1.1...v0.1.2
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## Sensu-Plugins-slack
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-slack.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-slack)
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-slack.svg)](
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-slack.svg)](https://badge.fury.io/rb/sensu-plugins-slack)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-slack)
|
7
7
|
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-slack.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-slack)
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"proxy_port": "The HTTP proxy port (if there is a proxy)",
|
30
30
|
"proxy_username": "The HTTP proxy username (if there is a proxy)",
|
31
31
|
"proxy_password": "The HTTP proxy user password (if there is a proxy)",
|
32
|
-
"icon_url": "
|
32
|
+
"icon_url": "https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png",
|
33
33
|
"icon_emoji": ":snowman:",
|
34
34
|
"fields": [
|
35
35
|
"list",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
## Installation
|
46
46
|
|
47
|
-
[Installation and Setup](
|
47
|
+
[Installation and Setup](https://sensu-plugins.io/docs/installation_instructions.html)
|
48
48
|
|
49
49
|
## Notes
|
50
50
|
|
@@ -61,6 +61,10 @@ class Slack < Sensu::Handler
|
|
61
61
|
get_setting('template') || get_setting('message_template')
|
62
62
|
end
|
63
63
|
|
64
|
+
def slack_icon_url
|
65
|
+
get_setting('icon_url')
|
66
|
+
end
|
67
|
+
|
64
68
|
def slack_webhook_url
|
65
69
|
get_setting('webhook_url')
|
66
70
|
end
|
@@ -170,18 +174,18 @@ class Slack < Sensu::Handler
|
|
170
174
|
end
|
171
175
|
|
172
176
|
def build_description
|
173
|
-
if message_template && File.readable?(message_template)
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
177
|
+
template = if message_template && File.readable?(message_template)
|
178
|
+
File.read(message_template)
|
179
|
+
else
|
180
|
+
'''<%=
|
181
|
+
[
|
182
|
+
@event["check"]["output"].gsub(\'"\', \'\\"\'),
|
183
|
+
@event["client"]["address"],
|
184
|
+
@event["client"]["subscriptions"].join(",")
|
185
|
+
].join(" : ")
|
186
|
+
%>
|
187
|
+
'''
|
188
|
+
end
|
185
189
|
eruby = Erubis::Eruby.new(template)
|
186
190
|
eruby.result(binding)
|
187
191
|
end
|
@@ -228,7 +232,7 @@ class Slack < Sensu::Handler
|
|
228
232
|
|
229
233
|
def payload(notice, channel)
|
230
234
|
{
|
231
|
-
icon_url: '
|
235
|
+
icon_url: slack_icon_url ? slack_icon_url : 'https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png',
|
232
236
|
attachments: [{
|
233
237
|
title: "#{@event['client']['address']} - #{translate_status}",
|
234
238
|
text: [slack_message_prefix, notice].compact.join(' '),
|
data/bin/handler-slack.rb
CHANGED
@@ -107,18 +107,18 @@ class Slack < Sensu::Handler
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def build_description
|
110
|
-
if message_template && File.readable?(message_template)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
110
|
+
template = if message_template && File.readable?(message_template)
|
111
|
+
File.read(message_template)
|
112
|
+
else
|
113
|
+
'''<%=
|
114
|
+
[
|
115
|
+
@event["check"]["output"].gsub(\'"\', \'\\"\'),
|
116
|
+
@event["client"]["address"],
|
117
|
+
@event["client"]["subscriptions"].join(",")
|
118
|
+
].join(" : ")
|
119
|
+
%>
|
120
|
+
'''
|
121
|
+
end
|
122
122
|
eruby = Erubis::Eruby.new(template)
|
123
123
|
eruby.result(binding)
|
124
124
|
end
|
@@ -171,7 +171,7 @@ class Slack < Sensu::Handler
|
|
171
171
|
end
|
172
172
|
|
173
173
|
{
|
174
|
-
icon_url: slack_icon_url ? slack_icon_url : '
|
174
|
+
icon_url: slack_icon_url ? slack_icon_url : 'https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png',
|
175
175
|
attachments: [{
|
176
176
|
title: "#{@event['client']['address']} - #{translate_status}",
|
177
177
|
text: [slack_message_prefix, notice].compact.join(' '),
|
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: 1.1.
|
4
|
+
version: 1.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: 2017-06-
|
11
|
+
date: 2017-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|