sensu 0.9.6.beta.6 → 0.9.6.beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.9.6.beta.6'
3
+ VERSION = '0.9.6.beta.7'
4
4
  end
5
5
 
6
6
  unless defined?(Sensu::DEFAULT_OPTIONS)
data/lib/sensu/server.rb CHANGED
@@ -208,9 +208,22 @@ module Sensu
208
208
  :event => event,
209
209
  :exchange => handler[:exchange]
210
210
  })
211
- payload = handler[:send_only_check_output] ? event[:check][:output] : event.to_json
212
- unless payload.empty?
213
- @amq.method(exchange_type).call(exchange_name, exchange_options).publish(payload)
211
+ payloads = Array.new
212
+ if handler[:send_only_check_output]
213
+ if handler[:split_check_output]
214
+ event[:check][:output].split(/\n+/).each do |line|
215
+ payloads.push(line)
216
+ end
217
+ else
218
+ payloads.push(event[:check][:output])
219
+ end
220
+ else
221
+ payloads.push(event.to_json)
222
+ end
223
+ payloads.each do |payload|
224
+ unless payload.empty?
225
+ @amq.method(exchange_type).call(exchange_name, exchange_options).publish(payload)
226
+ end
214
227
  end
215
228
  @handlers_in_progress -= 1
216
229
  when 'set'
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: 62196239
4
+ hash: 62196237
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 6
10
10
  - beta
11
- - 6
12
- version: 0.9.6.beta.6
11
+ - 7
12
+ version: 0.9.6.beta.7
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-05-27 00:00:00 -07:00
21
+ date: 2012-05-31 00:00:00 -07:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency