sensu 0.20.5-java → 0.20.6-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/sensu/api/process.rb +43 -30
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/daemon.rb +6 -6
- data/lib/sensu/server/filter.rb +9 -8
- data/sensu.gemspec +6 -7
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a54f2050a55757840257922d75b5fc25b2ecb2
|
4
|
+
data.tar.gz: f74d4efbc2ba470a991b09fc2fe3e1d026c28364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6432bd38ff20bbd9879b8bdfbf54a525d24620adff8f34625a2b182a0da0db8842afe65930447999379ecc83ff12baeb143b8410d283a2a634d7a24b6b2dedf6
|
7
|
+
data.tar.gz: b2e98918ef1b2e8ae76e7bb84335a5b7e33adbbf8380f080ff1e032a94dad7e17be6316098137faeee0341153b3b845b8c363e3fbf25543ec01b9cc138a4fe27
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 0.20.6 - 2015-09-22
|
2
|
+
|
3
|
+
### Other
|
4
|
+
|
5
|
+
Removed the use of `EM::Iterator` from event filtering, replacing it with
|
6
|
+
`Proc` and `EM::next_tick`. `EM::Iterator` creates anonymous classes that
|
7
|
+
cannot be garbage collected on JRuby.
|
8
|
+
|
9
|
+
Removed sensu-em as a dependency, now using upstream EventMachine 1.0.8.
|
10
|
+
|
11
|
+
The Sensu API will remove a client immediately if there are no current
|
12
|
+
events for it. The API will continue to monitor the current event count
|
13
|
+
for the client to be deleted, deleting the client when there are no longer
|
14
|
+
current events or after a timeout of 5 seconds.
|
15
|
+
|
16
|
+
The Sensu API will no longer crash while fetching check result data for a
|
17
|
+
client that is being deleted.
|
18
|
+
|
1
19
|
## 0.20.5 - 2015-09-09
|
2
20
|
|
3
21
|
### Other
|
data/lib/sensu/api/process.rb
CHANGED
@@ -337,9 +337,7 @@ module Sensu
|
|
337
337
|
unless client_json.nil?
|
338
338
|
response << MultiJson.load(client_json)
|
339
339
|
else
|
340
|
-
settings.logger.error("client
|
341
|
-
:client_name => client_name
|
342
|
-
})
|
340
|
+
settings.logger.error("client data missing from registry", :client_name => client_name)
|
343
341
|
settings.redis.srem("clients", client_name)
|
344
342
|
end
|
345
343
|
if index == clients.size - 1
|
@@ -375,17 +373,19 @@ module Sensu
|
|
375
373
|
status.to_i
|
376
374
|
end
|
377
375
|
settings.redis.get("result:#{result_key}") do |result_json|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
376
|
+
unless result_json.nil?
|
377
|
+
result = MultiJson.load(result_json)
|
378
|
+
last_execution = result[:executed]
|
379
|
+
unless history.empty? || last_execution.nil?
|
380
|
+
item = {
|
381
|
+
:check => check_name,
|
382
|
+
:history => history,
|
383
|
+
:last_execution => last_execution.to_i,
|
384
|
+
:last_status => history.last,
|
385
|
+
:last_result => result
|
386
|
+
}
|
387
|
+
response << item
|
388
|
+
end
|
389
389
|
end
|
390
390
|
if index == checks.size - 1
|
391
391
|
body MultiJson.dump(response)
|
@@ -406,22 +406,31 @@ module Sensu
|
|
406
406
|
events.each do |check_name, event_json|
|
407
407
|
resolve_event(event_json)
|
408
408
|
end
|
409
|
-
|
410
|
-
|
411
|
-
settings.
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
409
|
+
delete_client = Proc.new do |attempts|
|
410
|
+
attempts += 1
|
411
|
+
settings.redis.hgetall("events:#{client_name}") do |events|
|
412
|
+
if events.empty? || attempts == 5
|
413
|
+
settings.logger.info("deleting client from registry", :client_name => client_name)
|
414
|
+
settings.redis.srem("clients", client_name) do
|
415
|
+
settings.redis.del("client:#{client_name}")
|
416
|
+
settings.redis.del("events:#{client_name}")
|
417
|
+
settings.redis.smembers("result:#{client_name}") do |checks|
|
418
|
+
checks.each do |check_name|
|
419
|
+
result_key = "#{client_name}:#{check_name}"
|
420
|
+
settings.redis.del("result:#{result_key}")
|
421
|
+
settings.redis.del("history:#{result_key}")
|
422
|
+
end
|
423
|
+
settings.redis.del("result:#{client_name}")
|
424
|
+
end
|
425
|
+
end
|
426
|
+
else
|
427
|
+
EM::Timer.new(1) do
|
428
|
+
delete_client.call(attempts)
|
420
429
|
end
|
421
|
-
settings.redis.del("result:#{client_name}")
|
422
430
|
end
|
423
431
|
end
|
424
432
|
end
|
433
|
+
delete_client.call(0)
|
425
434
|
issued!
|
426
435
|
end
|
427
436
|
else
|
@@ -744,8 +753,10 @@ module Sensu
|
|
744
753
|
checks.each_with_index do |check_name, check_index|
|
745
754
|
result_key = "result:#{client_name}:#{check_name}"
|
746
755
|
settings.redis.get(result_key) do |result_json|
|
747
|
-
|
748
|
-
|
756
|
+
unless result_json.nil?
|
757
|
+
check = MultiJson.load(result_json)
|
758
|
+
response << {:client => client_name, :check => check}
|
759
|
+
end
|
749
760
|
if client_index == clients.size - 1 && check_index == checks.size - 1
|
750
761
|
body MultiJson.dump(response)
|
751
762
|
end
|
@@ -769,8 +780,10 @@ module Sensu
|
|
769
780
|
checks.each_with_index do |check_name, check_index|
|
770
781
|
result_key = "result:#{client_name}:#{check_name}"
|
771
782
|
settings.redis.get(result_key) do |result_json|
|
772
|
-
|
773
|
-
|
783
|
+
unless result_json.nil?
|
784
|
+
check = MultiJson.load(result_json)
|
785
|
+
response << {:client => client_name, :check => check}
|
786
|
+
end
|
774
787
|
if check_index == checks.size - 1
|
775
788
|
body MultiJson.dump(response)
|
776
789
|
end
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/daemon.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
|
3
3
|
gem "multi_json", "1.11.2"
|
4
|
+
gem "eventmachine", "1.0.8"
|
4
5
|
|
5
|
-
gem "sensu-
|
6
|
-
gem "sensu-logger", "1.0.0"
|
6
|
+
gem "sensu-logger", "1.1.0"
|
7
7
|
gem "sensu-settings", "3.1.0"
|
8
|
-
gem "sensu-extension", "1.
|
9
|
-
gem "sensu-extensions", "1.
|
10
|
-
gem "sensu-transport", "3.
|
11
|
-
gem "sensu-spawn", "1.
|
8
|
+
gem "sensu-extension", "1.2.0"
|
9
|
+
gem "sensu-extensions", "1.3.0"
|
10
|
+
gem "sensu-transport", "3.3.0"
|
11
|
+
gem "sensu-spawn", "1.5.0"
|
12
12
|
|
13
13
|
require "time"
|
14
14
|
require "uri"
|
data/lib/sensu/server/filter.rb
CHANGED
@@ -259,16 +259,17 @@ module Sensu
|
|
259
259
|
def event_filtered?(handler, event, &callback)
|
260
260
|
if handler.has_key?(:filters) || handler.has_key?(:filter)
|
261
261
|
filter_list = Array(handler[:filters] || handler[:filter])
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
262
|
+
filter = Proc.new do |filter_list|
|
263
|
+
filter_name = filter_list.shift
|
264
|
+
if filter_name.nil?
|
265
|
+
callback.call(false)
|
266
|
+
else
|
267
|
+
event_filter(filter_name, event) do |filtered|
|
268
|
+
filtered ? callback.call(true) : EM.next_tick { filter.call(filter_list) }
|
269
|
+
end
|
266
270
|
end
|
267
271
|
end
|
268
|
-
|
269
|
-
callback.call(results.any?)
|
270
|
-
end
|
271
|
-
filter_results.map(run_filters, filtered)
|
272
|
+
EM.next_tick { filter.call(filter_list) }
|
272
273
|
else
|
273
274
|
callback.call(false)
|
274
275
|
end
|
data/sensu.gemspec
CHANGED
@@ -16,14 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency "json" if RUBY_VERSION < "1.9"
|
17
17
|
s.add_dependency "multi_json", "1.11.2"
|
18
18
|
s.add_dependency "uuidtools", "2.1.5"
|
19
|
-
s.add_dependency "eventmachine", "1.0.
|
20
|
-
s.add_dependency "sensu-
|
21
|
-
s.add_dependency "sensu-logger", "1.0.0"
|
19
|
+
s.add_dependency "eventmachine", "1.0.8"
|
20
|
+
s.add_dependency "sensu-logger", "1.1.0"
|
22
21
|
s.add_dependency "sensu-settings", "3.1.0"
|
23
|
-
s.add_dependency "sensu-extension", "1.
|
24
|
-
s.add_dependency "sensu-extensions", "1.
|
25
|
-
s.add_dependency "sensu-transport", "3.
|
26
|
-
s.add_dependency "sensu-spawn", "1.
|
22
|
+
s.add_dependency "sensu-extension", "1.2.0"
|
23
|
+
s.add_dependency "sensu-extensions", "1.3.0"
|
24
|
+
s.add_dependency "sensu-transport", "3.3.0"
|
25
|
+
s.add_dependency "sensu-spawn", "1.5.0"
|
27
26
|
s.add_dependency "em-redis-unified", "1.0.0"
|
28
27
|
s.add_dependency "sinatra", "1.4.6"
|
29
28
|
s.add_dependency "async_sinatra", "1.2.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.6
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -45,26 +45,12 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.0.
|
48
|
+
version: 1.0.8
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.0.
|
54
|
-
prerelease: false
|
55
|
-
type: :runtime
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: sensu-em
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - '='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 2.5.2
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - '='
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 2.5.2
|
53
|
+
version: 1.0.8
|
68
54
|
prerelease: false
|
69
55
|
type: :runtime
|
70
56
|
- !ruby/object:Gem::Dependency
|
@@ -73,12 +59,12 @@ dependencies:
|
|
73
59
|
requirements:
|
74
60
|
- - '='
|
75
61
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.
|
62
|
+
version: 1.1.0
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
78
64
|
requirements:
|
79
65
|
- - '='
|
80
66
|
- !ruby/object:Gem::Version
|
81
|
-
version: 1.
|
67
|
+
version: 1.1.0
|
82
68
|
prerelease: false
|
83
69
|
type: :runtime
|
84
70
|
- !ruby/object:Gem::Dependency
|
@@ -101,12 +87,12 @@ dependencies:
|
|
101
87
|
requirements:
|
102
88
|
- - '='
|
103
89
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.
|
90
|
+
version: 1.2.0
|
105
91
|
requirement: !ruby/object:Gem::Requirement
|
106
92
|
requirements:
|
107
93
|
- - '='
|
108
94
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.
|
95
|
+
version: 1.2.0
|
110
96
|
prerelease: false
|
111
97
|
type: :runtime
|
112
98
|
- !ruby/object:Gem::Dependency
|
@@ -115,12 +101,12 @@ dependencies:
|
|
115
101
|
requirements:
|
116
102
|
- - '='
|
117
103
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.
|
104
|
+
version: 1.3.0
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
120
106
|
requirements:
|
121
107
|
- - '='
|
122
108
|
- !ruby/object:Gem::Version
|
123
|
-
version: 1.
|
109
|
+
version: 1.3.0
|
124
110
|
prerelease: false
|
125
111
|
type: :runtime
|
126
112
|
- !ruby/object:Gem::Dependency
|
@@ -129,12 +115,12 @@ dependencies:
|
|
129
115
|
requirements:
|
130
116
|
- - '='
|
131
117
|
- !ruby/object:Gem::Version
|
132
|
-
version: 3.
|
118
|
+
version: 3.3.0
|
133
119
|
requirement: !ruby/object:Gem::Requirement
|
134
120
|
requirements:
|
135
121
|
- - '='
|
136
122
|
- !ruby/object:Gem::Version
|
137
|
-
version: 3.
|
123
|
+
version: 3.3.0
|
138
124
|
prerelease: false
|
139
125
|
type: :runtime
|
140
126
|
- !ruby/object:Gem::Dependency
|
@@ -143,12 +129,12 @@ dependencies:
|
|
143
129
|
requirements:
|
144
130
|
- - '='
|
145
131
|
- !ruby/object:Gem::Version
|
146
|
-
version: 1.
|
132
|
+
version: 1.5.0
|
147
133
|
requirement: !ruby/object:Gem::Requirement
|
148
134
|
requirements:
|
149
135
|
- - '='
|
150
136
|
- !ruby/object:Gem::Version
|
151
|
-
version: 1.
|
137
|
+
version: 1.5.0
|
152
138
|
prerelease: false
|
153
139
|
type: :runtime
|
154
140
|
- !ruby/object:Gem::Dependency
|