sensu-plugins-slack 1.4.0 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0898d7f8bf6098fa616bc6cca6c84767b2b7c396
4
- data.tar.gz: 0c4b6d37a6e734c558fbb6d221de05184a708cac
3
+ metadata.gz: b5d9792cd891cd11a656b1dc520d67bd162ffb99
4
+ data.tar.gz: 3f75a94527464e1c0151aa534c75230ed58e61ca
5
5
  SHA512:
6
- metadata.gz: 36d283b289b924ce4c22c1e722e3df728eadc23de79f478867579da11b196c3f2ee883a40e7ad73f35c72b70465b276f285b03f928c37b6a46793b1901ad365e
7
- data.tar.gz: c054fe9cae7cc838032fb13ec3736829d9a6e863bb3c885a7f8813ccaddd5d2c6ddd1d80095cc09d222878c5b7400c63e9195c26d6486d03d8e2626ebe3425b4
6
+ metadata.gz: f6b16d0d40943967aade3a6454d49ca125ab7138ac52db099524a07aaa8ce9a3ea945bfc60840b7a1662eec6e2119b3a865d897919b6537b27f3c948163231cf
7
+ data.tar.gz: 646fbe19dc32719deea3c4eecbb35ffe0298b54e59c3b0f860282515d0217847127a414cc5aa3885f9fa51fbea12eb2822e7da2713542faf62bf5a665cf11406
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
+ ## [1.5.0] - 2017-08-07
9
+ ### Added
10
+ - `handler-slack.rb`: Add param dashboard to show http link on client notification
11
+
8
12
  ## [1.4.0] - 2017-07-24
9
13
  ### Added
10
14
  - `slack-handler-multichannel.rb`: Added support for client-defined channel overrides (@fildred13)
@@ -93,7 +97,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
93
97
  ### Added
94
98
  - initial release
95
99
 
96
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.2.0...HEAD
100
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.5.0...HEAD
101
+ [1.5.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.4.0...1.5.0
102
+ [1.4.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.3.0...1.4.0
97
103
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.2.0...1.3.0
98
104
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.1...1.2.0
99
105
  [1.1.1]: https://github.com/sensu-plugins/sensu-plugins-slack/compare/1.1.0...1.1.1.
data/README.md CHANGED
@@ -17,6 +17,7 @@
17
17
  {
18
18
  "slack": {
19
19
  "webhook_url": "webhook url",
20
+ "dashboard": "uchiwa url, add link to slack notification. Format: http://sensu.com/#/client/$DataCenter/, optional",
20
21
  "channel": "#notifications-room, optional defaults to slack defined",
21
22
  "message_prefix": "optional prefix - can be used for mentions",
22
23
  "surround": "optional - can be used for bold(*), italics(_), code(`) and preformatted(```)",
data/bin/handler-slack.rb CHANGED
@@ -82,8 +82,16 @@ class Slack < Sensu::Handler
82
82
  get_setting('proxy_password')
83
83
  end
84
84
 
85
+ def dashboard_uri
86
+ get_setting('dashboard')
87
+ end
88
+
85
89
  def incident_key
86
- @event['client']['name'] + '/' + @event['check']['name']
90
+ if dashboard_uri.nil?
91
+ @event['client']['name'] + '/' + @event['check']['name']
92
+ else
93
+ "<#{dashboard_uri}#{@event['client']['name']}?check=#{@event['check']['name']}|#{@event['client']['name']}/#{@event['check']['name']}>"
94
+ end
87
95
  end
88
96
 
89
97
  def get_setting(name)
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsSlack
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 4
4
+ MINOR = 5
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-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.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-07-25 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis