lita-sensu2 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -3
- data/README.md +1 -0
- data/lib/lita/handlers/sensu2.rb +16 -0
- data/lita-sensu2.gemspec +1 -1
- data/templates/silences.erb +15 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e32b3e976852fc5b9eeecc4ad0361db7aae743d
|
4
|
+
data.tar.gz: 6c80b833b6f8e610639dc970c0964f3a82802749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a6e09879ff8e1569c81bb89f695004567f3012ed5c523490f54a64d6691fe120498fb48ca819af2f6733ce2679e463aeaa0a67803184b037426fd9a24b98358
|
7
|
+
data.tar.gz: b4d96add2327db29f13e3731b762d95db019be3b7f3d51c7c5c6c690ddb8a96c30fd2d4dd3c1dfac4dcec6f12a578262fdb4175f23dd1d9e3f4c2a3d11c1fe69
|
data/.travis.yml
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: required
|
3
3
|
rvm:
|
4
|
-
|
4
|
+
- 2.3.3
|
5
5
|
script: bundle exec rake
|
6
6
|
before_install:
|
7
|
-
|
7
|
+
- gem update --system
|
8
8
|
services:
|
9
|
-
|
9
|
+
- redis-server
|
10
|
+
deploy:
|
11
|
+
provider: rubygems
|
12
|
+
api_key:
|
13
|
+
secure: mD1q14xOhMLx1RTJzSEX/a/Xf8L3axRXeW74N9lrHfmrBbk5I5/O1yT14Al89tLZ99A3Qm3AV/eOhsZXxc2MftdJ2lpmGWhnoaeAMD50ie5XTzIsFRsUMZkMdVhwEBC9Tj8OSB3jNc0hwzb/FPD72RU41vb43rDaMHTmjA/170cDpAyFlZq9lmWSeCPBM59UBwSlWZdyHzfGV2FyZt8wFFIZ/dCuZ+mwkrjbx9cZdwdBGDWWRDCF/61hkb2Blm5ufTqW235gSMdeYIkNt3RtXXgm4B2tiRixNZFZMloRwjvR+B240WkwoQKb/95FTgZAlqVAo88SqVNqaYp1CBTFkeh9fbEpWel83ddxTOqz1KjLRa9wSlY5Gv20L5ZuLasIIowH6RYG7ezOBMArvLTt7UehTpQLnmgRNyze0pBgoG5/m6P9WOavb7imtNaDGN4/zMe9DD29g4+ngxjtuBtfQseGDnoJw62H2aJO8iZlNhVAhaMliz8O7gybL7MLyzvxSK1SXv6MAUZEGf71riUTSDTA6JzU3CbMJdLqPfk9YV0ZJ9kXBoztiCOx/+RjtQRLkQVv8rs+9sFf7s2302LWZJoMjHaZ8K6jnJ2MrByAK17mfrMJCU7YoJATWhN+yOehk0R/jHQTPj1YaUKmH8bom0QhgXiDu+lfH2nipGYLTac=
|
14
|
+
gem: lita-sensu2
|
15
|
+
on:
|
16
|
+
tags: true
|
17
|
+
repo: knuedge/lita-sensu2
|
data/README.md
CHANGED
@@ -40,6 +40,7 @@ Available commands:
|
|
40
40
|
`sensu remove client <client>` - Remove client from sensu
|
41
41
|
`sensu resolve event <client>[/service]` - Resolve event/all events for client
|
42
42
|
`sensu silence <hostname>[/<check>][ for <duration><units>]` - Silence event
|
43
|
+
`sensu silences` - List current silences
|
43
44
|
`sensu stashes` - Displays current sensu stashes
|
44
45
|
|
45
46
|
## License
|
data/lib/lita/handlers/sensu2.rb
CHANGED
@@ -66,6 +66,12 @@ module Lita
|
|
66
66
|
help: { 'sensu silence <hostname>[/<check>][ for <duration><units>]' => 'Silence event' }
|
67
67
|
)
|
68
68
|
|
69
|
+
route(
|
70
|
+
/^sensu silences$/,
|
71
|
+
:silences,
|
72
|
+
help: { 'sensu silences' => 'Displays current sensu silences' }
|
73
|
+
)
|
74
|
+
|
69
75
|
route(
|
70
76
|
/sensu stash(es)?/,
|
71
77
|
:stashes,
|
@@ -183,6 +189,16 @@ module Lita
|
|
183
189
|
response.reply silence_post_msg(resp, post_data, human_duration, check_alias(client, check))
|
184
190
|
end
|
185
191
|
|
192
|
+
def silences(response)
|
193
|
+
resp = http_get(silence_url)
|
194
|
+
if resp.status == 200
|
195
|
+
response.reply(render_template('silences', silences: sorted_by(resp.body, :subscription)))
|
196
|
+
else
|
197
|
+
log.warn("Sensu returned an internal error resolving #{silence_url}")
|
198
|
+
response.reply('An error occurred fetching silences')
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
186
202
|
def stashes(response)
|
187
203
|
stashes_url = "#{config.api_url}:#{config.api_port}/stashes"
|
188
204
|
resp = http_get(stashes_url)
|
data/lita-sensu2.gemspec
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
<% @silences.each do |silence| %>
|
2
|
+
<%= silence[:id] %>
|
3
|
+
<% if silence[:creator] %>
|
4
|
+
added by <%= silence[:creator] %>
|
5
|
+
<% end %>
|
6
|
+
<% if silence[:expire] != -1 %>
|
7
|
+
, expiring in <%= silence[:expire] %> seconds
|
8
|
+
<% end %>
|
9
|
+
<% if silence[:expire_on_resolve] %>
|
10
|
+
, expiring automatically on resolution
|
11
|
+
<% end %>
|
12
|
+
<% if silence[:reason] %>
|
13
|
+
, with reason '<%= silence[:reason] %>'
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-sensu2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- templates/client_history.erb
|
192
192
|
- templates/clients.erb
|
193
193
|
- templates/events.erb
|
194
|
+
- templates/silences.erb
|
194
195
|
- templates/stashes.erb
|
195
196
|
homepage: https://github.com/knuedge/lita-sensu2
|
196
197
|
licenses:
|
@@ -213,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
214
|
version: '0'
|
214
215
|
requirements: []
|
215
216
|
rubyforge_project:
|
216
|
-
rubygems_version: 2.
|
217
|
+
rubygems_version: 2.6.8
|
217
218
|
signing_key:
|
218
219
|
specification_version: 4
|
219
220
|
summary: Lita plugin to interact with sensu
|