sensu 0.9.3.beta.2 → 0.9.3.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sensu/config.rb +1 -1
- data/lib/sensu/server.rb +5 -5
- data/lib/sensu.rb +1 -1
- data/sensu.gemspec +1 -1
- metadata +6 -8
data/lib/sensu/config.rb
CHANGED
@@ -98,7 +98,7 @@ module Sensu
|
|
98
98
|
unless details['type'].is_a?(String)
|
99
99
|
invalid_config('missing type for handler ' + name)
|
100
100
|
end
|
101
|
-
case details
|
101
|
+
case details['type']
|
102
102
|
when 'pipe'
|
103
103
|
unless details.command.is_a?(String)
|
104
104
|
invalid_config('missing command for pipe handler ' + name)
|
data/lib/sensu/server.rb
CHANGED
@@ -74,7 +74,7 @@ module Sensu
|
|
74
74
|
['default']
|
75
75
|
end
|
76
76
|
handlers.map! do |handler|
|
77
|
-
@settings.handlers[handler]
|
77
|
+
@settings.handlers[handler]['type'] == 'set' ? @settings.handlers[handler].handlers : handler
|
78
78
|
end
|
79
79
|
handlers.flatten!
|
80
80
|
handlers.uniq!
|
@@ -89,7 +89,7 @@ module Sensu
|
|
89
89
|
@logger.debug('[event] -- handling event -- ' + [handler, event.client.name, event.check.name].join(' -- '))
|
90
90
|
@handlers_in_progress += 1
|
91
91
|
details = @settings.handlers[handler]
|
92
|
-
case details
|
92
|
+
case details['type']
|
93
93
|
when 'pipe'
|
94
94
|
execute = proc do
|
95
95
|
Bundler.with_clean_env do
|
@@ -111,7 +111,7 @@ module Sensu
|
|
111
111
|
EM::defer(execute, report)
|
112
112
|
when 'amqp'
|
113
113
|
exchange = details.exchange.name
|
114
|
-
exchange_type = details.exchange.key?('type') ? details.exchange
|
114
|
+
exchange_type = details.exchange.key?('type') ? details.exchange['type'].to_sym : :direct
|
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
|
@@ -205,13 +205,13 @@ module Sensu
|
|
205
205
|
else
|
206
206
|
@logger.debug('[result] -- check is flapping -- ' + [client.name, check.name, check.status].join(' -- '))
|
207
207
|
@redis.hset('events:' + client.name, check.name, previous_occurrence.merge(:flapping => true).to_json).callback do
|
208
|
-
if check
|
208
|
+
if check['type'] == 'metric'
|
209
209
|
event.check.flapping = is_flapping
|
210
210
|
handle_event(event)
|
211
211
|
end
|
212
212
|
end
|
213
213
|
end
|
214
|
-
elsif check
|
214
|
+
elsif check['type'] == 'metric'
|
215
215
|
handle_event(event)
|
216
216
|
end
|
217
217
|
end
|
data/lib/sensu.rb
CHANGED
data/sensu.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency("eventmachine", "~> 1.0.0.beta.4")
|
17
17
|
s.add_dependency("amqp", "0.7.4")
|
18
18
|
s.add_dependency("json")
|
19
|
-
s.add_dependency("hashie"
|
19
|
+
s.add_dependency("hashie")
|
20
20
|
s.add_dependency("cabin", "0.1.8")
|
21
21
|
s.add_dependency("ruby-redis")
|
22
22
|
s.add_dependency("rack", "~> 1.3.4")
|
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: 62196269
|
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
|
+
- 3
|
12
|
+
version: 0.9.3.beta.3
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Sean Porter
|
@@ -89,14 +89,12 @@ dependencies:
|
|
89
89
|
requirement: &id005 !ruby/object:Gem::Requirement
|
90
90
|
none: false
|
91
91
|
requirements:
|
92
|
-
- -
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
94
|
+
hash: 3
|
95
95
|
segments:
|
96
|
-
- 1
|
97
|
-
- 2
|
98
96
|
- 0
|
99
|
-
version:
|
97
|
+
version: "0"
|
100
98
|
type: :runtime
|
101
99
|
version_requirements: *id005
|
102
100
|
- !ruby/object:Gem::Dependency
|