sensu 0.9.3.beta.3 → 0.9.3.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sensu.rb +1 -1
- data/lib/sensu/api.rb +5 -3
- data/lib/sensu/config.rb +5 -0
- data/lib/sensu/server.rb +3 -1
- metadata +4 -4
data/lib/sensu.rb
CHANGED
data/lib/sensu/api.rb
CHANGED
@@ -302,9 +302,11 @@ module Sensu
|
|
302
302
|
:occurrences => 1
|
303
303
|
}.to_json).callback do
|
304
304
|
$redis.set('stash:test/test', '{"key": "value"}').callback do
|
305
|
-
|
306
|
-
|
307
|
-
|
305
|
+
$redis.sadd('stashes', 'test/test').callback do
|
306
|
+
Thin::Logging.silent = true
|
307
|
+
Thin::Server.start(self, $settings.api.port)
|
308
|
+
block.call
|
309
|
+
end
|
308
310
|
end
|
309
311
|
end
|
310
312
|
end
|
data/lib/sensu/config.rb
CHANGED
@@ -110,6 +110,11 @@ module Sensu
|
|
110
110
|
unless details.exchange.name.is_a?(String)
|
111
111
|
invalid_config('missing exchange name for amqp handler ' + name)
|
112
112
|
end
|
113
|
+
if details.exchange.key?('type')
|
114
|
+
unless %w[direct fanout topic].include?(details.exchange['type'])
|
115
|
+
invalid_config('invalid exchange type for amqp handler ' + name)
|
116
|
+
end
|
117
|
+
end
|
113
118
|
when 'set'
|
114
119
|
unless details.handlers.is_a?(Array) && details.handlers.count > 0
|
115
120
|
invalid_config('missing handler set for handler ' + name)
|
data/lib/sensu/server.rb
CHANGED
@@ -115,7 +115,9 @@ module Sensu
|
|
115
115
|
exchange_options = details.exchange.reject { |key, value| %w[name type].include?(key) }
|
116
116
|
@logger.debug('[event] -- publishing event to rabbitmq exchange -- ' + [exchange, event.client.name, event.check.name].join(' -- '))
|
117
117
|
payload = details.send_only_check_output ? event.check.output : event.to_json
|
118
|
-
|
118
|
+
unless payload.empty?
|
119
|
+
@amq.method(exchange_type).call(exchange, exchange_options).publish(payload)
|
120
|
+
end
|
119
121
|
@handlers_in_progress -= 1
|
120
122
|
when 'set'
|
121
123
|
@logger.warn('[event] -- handler sets cannot be nested -- ' + handler)
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196259
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 3
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 0.9.3.beta.
|
11
|
+
- 4
|
12
|
+
version: 0.9.3.beta.4
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Sean Porter
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2012-01-
|
21
|
+
date: 2012-01-18 00:00:00 -08:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|