lita-sensu 0.1.0 → 0.1.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 +4 -4
- data/README.md +28 -3
- data/lib/lita/handlers/sensu.rb +3 -3
- data/lita-sensu.gemspec +1 -1
- data/spec/lita/handlers/sensu_spec.rb +4 -0
- metadata +2 -3
- data/lib/lita/handlers/sensu_api.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b5befe154037c096d9e44b6d11580a41163735
|
4
|
+
data.tar.gz: 727ff8794a2b6c3d0b6b056a53b1b3a6fe68c80c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b742b422fb67017aa01b6128138c120484873c57c481d45993b249d785cb0947480e435bba5fb6afb773b775d1c2a53ba29f481bd5125c220b20147a9f28a328
|
7
|
+
data.tar.gz: 1720affdfd77459b26c38981a45f952b5cd0002689133ea82a139777e9bcbd3726f89ea588f357b6794ede886ec6b999500b23a35a3f9f1595eea9f996a2bee3
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# lita-sensu
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/lita-sensu)
|
3
4
|
[](https://travis-ci.org/jlambert121/lita-sensu)
|
4
5
|
[](https://coveralls.io/r/jlambert121/lita-sensu)
|
5
6
|
|
6
|
-
|
7
|
+
Lita handler for working with the [Sensu](http://sensuapp.org) monitoring framework.
|
7
8
|
|
9
|
+
**Note**: This handler requires Lita >= 4.3.
|
8
10
|
## Installation
|
9
11
|
|
10
12
|
Add lita-sensu to your Lita instance's Gemfile:
|
@@ -15,8 +17,31 @@ gem "lita-sensu"
|
|
15
17
|
|
16
18
|
## Configuration
|
17
19
|
|
18
|
-
|
20
|
+
The sensu handler needs to be configured with information about your sensu
|
21
|
+
installation. Add the following configuration to your `lita_config.rb`. All
|
22
|
+
parameters are optional, by default the handler will connect to 127.0.0.1:4567
|
23
|
+
for the sensu API service.
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
config.handlers.sensu.api_url = '127.0.0.1'
|
27
|
+
config.handlers.sensu.api_port = 4567
|
28
|
+
config.handlers.sensu.domain = 'mydomain.com'
|
29
|
+
```
|
19
30
|
|
20
31
|
## Usage
|
21
32
|
|
22
|
-
|
33
|
+
Available commands:
|
34
|
+
|
35
|
+
`sensu client <client>` - Shows information on a specific client
|
36
|
+
`sensu client <client> history` - Shows history information for a specific client
|
37
|
+
`sensu clients` - List sensu clients
|
38
|
+
`sensu events` [for <client>] - Shows current events, optionally for only a specific client
|
39
|
+
`sensu info` - Displays sensu information
|
40
|
+
`sensu remove client <client>` - Remove client from sensu
|
41
|
+
`sensu resolve event <client>[/service]` - Resolve event/all events for client
|
42
|
+
`sensu silence <hostname>[/<check>][ for <duration><units>]` - Silence event
|
43
|
+
`sensu stashes` - Displays current sensu stashes
|
44
|
+
|
45
|
+
## License
|
46
|
+
|
47
|
+
[Apache-2.0](http://opensource.org/licenses/Apache-2.0)
|
data/lib/lita/handlers/sensu.rb
CHANGED
@@ -17,9 +17,9 @@ module Lita
|
|
17
17
|
route(/sensu clients/, :clients, help: {"sensu clients" => "List sensu clients"})
|
18
18
|
route(/sensu events(?: for (.*))?/, :events, help: {"sensu events [for <client>]" => "Shows current events, optionally for only a specific client"})
|
19
19
|
route(/sensu info/, :info, help: { "sensu info" => "Displays sensu information"})
|
20
|
-
route(/sensu
|
21
|
-
route(/sensu
|
22
|
-
route(/sensu
|
20
|
+
route(/(?:sensu\s+)?remove client (.*)/, :remove_client, help: {"sensu remove client <client>" => "Remove client from sensu"})
|
21
|
+
route(/(?:sensu\s+)?resolve event (.*)(?:\/)(.*)/, :resolve, help: {"sensu resolve event <client>[/service]" => "Resolve event/all events for client"})
|
22
|
+
route(/(?:sensu\s+)?silence ([^\s\/]*)(?:\/)?([^\s]*)?(?: for (\d+)(\w))?/, :silence, help: {"sensu silence <hostname>[/<check>][ for <duration><units>]" => "Silence event"})
|
23
23
|
route(/sensu stash(es)?/, :stashes, help: {"sensu stashes" => "Displays current sensu stashes"})
|
24
24
|
|
25
25
|
def client(response)
|
data/lita-sensu.gemspec
CHANGED
@@ -9,8 +9,12 @@ describe Lita::Handlers::Sensu, lita_handler: true do
|
|
9
9
|
it { is_expected.to route_command('sensu events for test1').to(:events) }
|
10
10
|
it { is_expected.to route_command('sensu info').to(:info) }
|
11
11
|
it { is_expected.to route_command('sensu remove client test1').to(:remove_client) }
|
12
|
+
it { is_expected.to route_command('remove client test1').to(:remove_client) }
|
12
13
|
it { is_expected.to route_command('sensu resolve event test1/check2').to(:resolve) }
|
14
|
+
it { is_expected.to route_command('resolve event test1/check2').to(:resolve) }
|
15
|
+
it { is_expected.to route_command('resolve event test1/check2').to(:resolve) }
|
13
16
|
it { is_expected.to route_command('sensu silence test1').to(:silence) }
|
17
|
+
it { is_expected.to route_command('silence test1').to(:silence) }
|
14
18
|
it { is_expected.to route_command('sensu silence test1 check2').to(:silence) }
|
15
19
|
it { is_expected.to route_command('sensu silence test1/check2').to(:silence) }
|
16
20
|
it { is_expected.to route_command('sensu stashes').to(:stashes) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Lambert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -137,7 +137,6 @@ files:
|
|
137
137
|
- Rakefile
|
138
138
|
- lib/lita-sensu.rb
|
139
139
|
- lib/lita/handlers/sensu.rb
|
140
|
-
- lib/lita/handlers/sensu_api.rb
|
141
140
|
- lita-sensu.gemspec
|
142
141
|
- locales/en.yml
|
143
142
|
- spec/lita/handlers/sensu_spec.rb
|