sensu 0.8.6 → 0.8.7
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.
- data/README.org +1 -0
- data/lib/sensu.rb +1 -1
- data/lib/sensu/api.rb +25 -0
- metadata +4 -4
data/README.org
CHANGED
data/lib/sensu.rb
CHANGED
data/lib/sensu/api.rb
CHANGED
@@ -129,6 +129,31 @@ module Sensu
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
+
apost '/event/resolve' do
|
133
|
+
$logger.debug('[event] -- ' + request.ip + ' -- POST -- request to resolve event')
|
134
|
+
begin
|
135
|
+
event = JSON.parse(request.body.read)
|
136
|
+
rescue JSON::ParserError
|
137
|
+
status 400
|
138
|
+
body nil
|
139
|
+
end
|
140
|
+
if event.has_key?('client') && event.has_key?('check')
|
141
|
+
$redis.hgetall('events:' + event['client']).callback do |events|
|
142
|
+
if Hash[*events][event['check']]
|
143
|
+
check = {:name => event['check'], :issued => Time.now.to_i, :status => 0, :output => 'Resolving on request of the API'}
|
144
|
+
$amq.queue('results').publish({:client => event['client'], :check => check}.to_json)
|
145
|
+
status 201
|
146
|
+
else
|
147
|
+
status 404
|
148
|
+
end
|
149
|
+
body nil
|
150
|
+
end
|
151
|
+
else
|
152
|
+
status 400
|
153
|
+
body nil
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
132
157
|
apost '/stash/*' do |path|
|
133
158
|
$logger.debug('[stash] -- ' + request.ip + ' -- POST -- request for stash -- ' + path)
|
134
159
|
begin
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 49
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 7
|
10
|
+
version: 0.8.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Porter
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-14 00:00:00 -08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|