sensu 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/sensu/server.rb +8 -7
  2. data/lib/sensu.rb +1 -1
  3. 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
- result = Hash.new
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
- result['output'] = io.read
69
+ output = io.read
70
70
  end
71
- result['status'] = $?.exitstatus
72
- result
71
+ output
73
72
  end
74
- report = proc do |result|
75
- EM.debug('handled :: ' + event['check']['handler'] + ' :: ' + result['status'].to_s + ' :: ' + result['output'])
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('published :: ' + exchange + ' :: ' + name)
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
@@ -1,3 +1,3 @@
1
1
  module Sensu
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.3
5
+ version: 0.6.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sean Porter