sensu-plugins-slack 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5d9792cd891cd11a656b1dc520d67bd162ffb99
4
- data.tar.gz: 3f75a94527464e1c0151aa534c75230ed58e61ca
3
+ metadata.gz: 7f3f9a918ef13d9b355b40c09354e1c88729a3ae
4
+ data.tar.gz: 9852fac7e1faf796eb9e7fd0fd3a5f7366e37d1f
5
5
  SHA512:
6
- metadata.gz: f6b16d0d40943967aade3a6454d49ca125ab7138ac52db099524a07aaa8ce9a3ea945bfc60840b7a1662eec6e2119b3a865d897919b6537b27f3c948163231cf
7
- data.tar.gz: 646fbe19dc32719deea3c4eecbb35ffe0298b54e59c3b0f860282515d0217847127a414cc5aa3885f9fa51fbea12eb2822e7da2713542faf62bf5a665cf11406
6
+ metadata.gz: c6d3c867acafaf6b89cb500fe2cd4240c8e93beeae9b555873ed4ed69d44713268faf840745a3ea267c487540b5a93bee12b3bfb40576a1749b0d21f690b105d
7
+ data.tar.gz: ed616147d09b618f9ee203a5d00ce561bc61ec3d12b5730e3609df9385e48657fcafdc7a51c3d984f8057b82fbf9bc173641f024d6a4d729224e64919e165bfa
@@ -4,6 +4,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+ ## [1.5.1] - 2017-08-18
8
+ ### Fixed
9
+ - `handler-slack-multichannel.rb`: Add param webhook_urls to support one webhook_url per channel
10
+
11
+ ### Added
12
+ - slack badge to README.
7
13
 
8
14
  ## [1.5.0] - 2017-08-07
9
15
  ### Added
@@ -98,6 +104,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
98
104
  - initial release
99
105
 
100
106
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.5.0...HEAD
107
+ [1.5.1]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.5.0...1.5.1
101
108
  [1.5.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.4.0...1.5.0
102
109
  [1.4.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.3.0...1.4.0
103
110
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.2.0...1.3.0
data/README.md CHANGED
@@ -5,6 +5,8 @@
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)
8
+ [![Community Slack](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/badge)
9
+
8
10
 
9
11
  ## Functionality
10
12
 
@@ -46,10 +48,13 @@
46
48
  ```
47
49
  {
48
50
  "slack": {
49
- "webhook_url": "webhook url",
51
+ "webhook_urls": {
52
+ "no-team-alerts": "https://hooks.slack.com/services/AAAAAAA",
53
+ "all-alerts": "https://hooks.slack.com/services/BBBBBB"
54
+ },
50
55
  "channel": {
51
- "default": [ "#no-team-alerts" ],
52
- "compulsory": [ "#all-alerts" ]
56
+ "default": [ "no-team-alerts" ],
57
+ "compulsory": [ "all-alerts" ]
53
58
  }
54
59
  "message_prefix": "optional prefix - can be used for mentions",
55
60
  "surround": "optional - can be used for bold(*), italics(_), code(`) and preformatted(```)",
@@ -101,10 +101,6 @@ class Slack < Sensu::Handler
101
101
  get_setting('icon_url')
102
102
  end
103
103
 
104
- def slack_webhook_url
105
- get_setting('webhook_url')
106
- end
107
-
108
104
  def slack_icon_emoji
109
105
  get_setting('icon_emoji')
110
106
  end
@@ -129,6 +125,10 @@ class Slack < Sensu::Handler
129
125
  get_setting('surround')
130
126
  end
131
127
 
128
+ def webhook_urls
129
+ get_setting('webhook_urls')
130
+ end
131
+
132
132
  def default_channels
133
133
  return get_setting('channels')['default']
134
134
  rescue
@@ -244,6 +244,7 @@ class Slack < Sensu::Handler
244
244
  end
245
245
 
246
246
  def post_data(notice, channel)
247
+ slack_webhook_url = webhook_urls[channel]
247
248
  uri = URI(slack_webhook_url)
248
249
 
249
250
  http = if defined?(slack_proxy_addr).nil?
@@ -2,7 +2,7 @@ module SensuPluginsSlack
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.5.0
4
+ version: 1.5.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-08-07 00:00:00.000000000 Z
11
+ date: 2017-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis