sensu 0.6.3-x86-mingw32 → 0.6.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sensu/server.rb +8 -7
- data/lib/sensu.rb +1 -1
- metadata +1 -1
data/lib/sensu/server.rb
CHANGED
@@ -62,17 +62,18 @@ module Sensu
|
|
62
62
|
|
63
63
|
def handle_event(event)
|
64
64
|
handler = proc do
|
65
|
-
|
65
|
+
output = ''
|
66
66
|
IO.popen(@settings['handlers'][event['check']['handler']] + ' 2>&1', 'r+') do |io|
|
67
67
|
io.write(JSON.pretty_generate(event))
|
68
68
|
io.close_write
|
69
|
-
|
69
|
+
output = io.read
|
70
70
|
end
|
71
|
-
|
72
|
-
result
|
71
|
+
output
|
73
72
|
end
|
74
|
-
report = proc do |
|
75
|
-
|
73
|
+
report = proc do |output|
|
74
|
+
output.split(/\n+/).each do |line|
|
75
|
+
EM.debug(line)
|
76
|
+
end
|
76
77
|
end
|
77
78
|
EM.defer(handler, report)
|
78
79
|
end
|
@@ -133,7 +134,7 @@ module Sensu
|
|
133
134
|
interval = options[:test] ? 0.5 : details['interval']
|
134
135
|
EM.add_periodic_timer(interval) do
|
135
136
|
exchanges[exchange].publish({'name' => name, 'issued' => Time.now.to_i}.to_json)
|
136
|
-
EM.debug('
|
137
|
+
EM.debug('name="Published Check" event_id=server action="Published check ' + name + ' to the ' + exchange + ' exchange"')
|
137
138
|
end
|
138
139
|
end
|
139
140
|
end
|
data/lib/sensu.rb
CHANGED