sensu 0.16.0 → 0.17.0.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/sensu/client.rb +16 -10
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/daemon.rb +1 -1
- data/lib/sensu/server.rb +37 -32
- data/sensu.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 353194762fe5d578ba9a0fab7a901d3d33dd2cce
|
4
|
+
data.tar.gz: 5a9eeacb29a9dce4103c3847181959bb431e9cf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4945f1f379551daefb88be0a0b4ede8d82719f829b414410d5e66f65f069a482d62ec7718468b98379eede3e06941a9784ae663885a68aa359d336719f7459e1
|
7
|
+
data.tar.gz: 9db84ddb99d930aa80f632215616985a98f8b58a2c50078d1b4fc8896013b425329b60682759238c1b34c667d92b63f6425303a04ef6dca735bab7e5d8f8c47e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## 0.17.0 - TBD
|
2
|
+
|
3
|
+
### Features
|
4
|
+
|
5
|
+
Improved Sensu client keepalive event check output.
|
6
|
+
|
7
|
+
Hashed initial check request/execution scheduling splay, consistent over
|
8
|
+
process restarts/reloads.
|
9
|
+
|
10
|
+
Sensu event ID logged for event handler output.
|
11
|
+
|
12
|
+
### Other
|
13
|
+
|
14
|
+
Fixed TLS/SSL on Windows.
|
15
|
+
|
16
|
+
Fixed event filtering with event action, eg. `"action": "create"`.
|
17
|
+
|
1
18
|
## 0.16.0 - 2014-10-31
|
2
19
|
|
3
20
|
### Other
|
data/lib/sensu/client.rb
CHANGED
@@ -184,18 +184,24 @@ module Sensu
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
+
def calculate_execution_splay(check)
|
188
|
+
key = [@settings[:client][:name], check[:name]].join(':')
|
189
|
+
splay_hash = Digest::MD5.digest(key).unpack('Q<').first
|
190
|
+
current_time = (Time.now.to_f * 1000).to_i
|
191
|
+
(splay_hash - current_time) % (check[:interval] * 1000) / 1000.0
|
192
|
+
end
|
193
|
+
|
187
194
|
def schedule_checks(checks)
|
188
|
-
check_count = 0
|
189
|
-
stagger = testing? ? 0 : 2
|
190
195
|
checks.each do |check|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
196
|
+
execute_check = Proc.new do
|
197
|
+
check[:issued] = Time.now.to_i
|
198
|
+
process_check(check.dup)
|
199
|
+
end
|
200
|
+
execution_splay = testing? ? 0 : calculate_execution_splay(check)
|
201
|
+
interval = testing? ? 0.5 : check[:interval]
|
202
|
+
@timers[:run] << EM::Timer.new(execution_splay) do
|
203
|
+
execute_check.call
|
204
|
+
@timers[:run] << EM::PeriodicTimer.new(interval, &execute_check)
|
199
205
|
end
|
200
206
|
end
|
201
207
|
end
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/daemon.rb
CHANGED
data/lib/sensu/server.rb
CHANGED
@@ -94,6 +94,8 @@ module Sensu
|
|
94
94
|
true
|
95
95
|
when hash_one[key].is_a?(Hash) && hash_two[key].is_a?(Hash)
|
96
96
|
filter_attributes_match?(hash_one[key], hash_two[key])
|
97
|
+
when hash_one[key].to_s == hash_two[key].to_s
|
98
|
+
true
|
97
99
|
when hash_one[key].is_a?(String) && hash_one[key].start_with?('eval:')
|
98
100
|
begin
|
99
101
|
expression = hash_one[key].gsub(/^eval:(\s+)?/, '')
|
@@ -263,12 +265,11 @@ module Sensu
|
|
263
265
|
when 'pipe'
|
264
266
|
options = {:data => event_data, :timeout => handler[:timeout]}
|
265
267
|
Spawn.process(handler[:command], options) do |output, status|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
end
|
268
|
+
@logger.info('handler output', {
|
269
|
+
:handler => handler,
|
270
|
+
:output => output.lines,
|
271
|
+
:event_id => event[:id]
|
272
|
+
})
|
272
273
|
@handlers_in_progress_count -= 1
|
273
274
|
end
|
274
275
|
when 'tcp'
|
@@ -313,12 +314,11 @@ module Sensu
|
|
313
314
|
@handlers_in_progress_count -= 1
|
314
315
|
when 'extension'
|
315
316
|
handler.safe_run(event_data) do |output, status|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
end
|
317
|
+
@logger.info('handler extension output', {
|
318
|
+
:extension => handler.definition,
|
319
|
+
:output => output,
|
320
|
+
:event_id => event[:id]
|
321
|
+
})
|
322
322
|
@handlers_in_progress_count -= 1
|
323
323
|
end
|
324
324
|
end
|
@@ -506,24 +506,29 @@ module Sensu
|
|
506
506
|
end
|
507
507
|
end
|
508
508
|
|
509
|
+
def calculate_execution_splay(check)
|
510
|
+
splay_hash = Digest::MD5.digest(check[:name]).unpack('Q<').first
|
511
|
+
current_time = (Time.now.to_f * 1000).to_i
|
512
|
+
(splay_hash - current_time) % (check[:interval] * 1000) / 1000.0
|
513
|
+
end
|
514
|
+
|
509
515
|
def schedule_checks(checks)
|
510
|
-
check_count = 0
|
511
|
-
stagger = testing? ? 0 : 2
|
512
516
|
checks.each do |check|
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
else
|
521
|
-
@logger.info('check request was subdued', {
|
522
|
-
:check => check
|
523
|
-
})
|
524
|
-
end
|
517
|
+
process_check_request = Proc.new do
|
518
|
+
unless check_request_subdued?(check)
|
519
|
+
publish_check_request(check)
|
520
|
+
else
|
521
|
+
@logger.info('check request was subdued', {
|
522
|
+
:check => check
|
523
|
+
})
|
525
524
|
end
|
526
525
|
end
|
526
|
+
execution_splay = testing? ? 0 : calculate_execution_splay(check)
|
527
|
+
interval = testing? ? 0.5 : check[:interval]
|
528
|
+
@timers[:master] << EM::Timer.new(execution_splay) do
|
529
|
+
process_check_request.call
|
530
|
+
@timers[:master] << EM::PeriodicTimer.new(interval, &process_check_request)
|
531
|
+
end
|
527
532
|
end
|
528
533
|
end
|
529
534
|
|
@@ -580,18 +585,18 @@ module Sensu
|
|
580
585
|
check[:issued] = Time.now.to_i
|
581
586
|
check[:executed] = Time.now.to_i
|
582
587
|
time_since_last_keepalive = Time.now.to_i - client[:timestamp]
|
588
|
+
check[:output] = 'No keepalive sent from client for '
|
589
|
+
check[:output] << time_since_last_keepalive.to_s + ' seconds'
|
583
590
|
case
|
584
591
|
when time_since_last_keepalive >= check[:thresholds][:critical]
|
585
|
-
check[:output]
|
586
|
-
check[:output] << check[:thresholds][:critical].to_s + ' seconds'
|
592
|
+
check[:output] << ' (>=' + check[:thresholds][:critical].to_s + ')'
|
587
593
|
check[:status] = 2
|
588
594
|
when time_since_last_keepalive >= check[:thresholds][:warning]
|
589
|
-
check[:output]
|
590
|
-
check[:output] << check[:thresholds][:warning].to_s + ' seconds'
|
595
|
+
check[:output] << ' (>=' + check[:thresholds][:warning].to_s + ')'
|
591
596
|
check[:status] = 1
|
592
597
|
else
|
593
|
-
check[:output] = '
|
594
|
-
check[:output] <<
|
598
|
+
check[:output] = 'Keepalive sent from client '
|
599
|
+
check[:output] << time_since_last_keepalive.to_s + ' seconds ago'
|
595
600
|
check[:status] = 0
|
596
601
|
end
|
597
602
|
publish_result(client, check)
|
data/sensu.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency('json') if RUBY_VERSION < "1.9"
|
17
17
|
s.add_dependency('multi_json', '1.10.1')
|
18
18
|
s.add_dependency('uuidtools', '2.1.4')
|
19
|
-
s.add_dependency('sensu-em', '2.4.
|
19
|
+
s.add_dependency('sensu-em', '2.4.1')
|
20
20
|
s.add_dependency('sensu-logger', '1.0.0')
|
21
21
|
s.add_dependency('sensu-settings', '1.2.0')
|
22
22
|
s.add_dependency('sensu-extension', '1.0.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.
|
4
|
+
version: 0.17.0.beta
|
5
5
|
platform: ruby
|
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:
|
12
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 2.4.
|
48
|
+
version: 2.4.1
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 2.4.
|
55
|
+
version: 2.4.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: sensu-logger
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -279,9 +279,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
279
279
|
version: '0'
|
280
280
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
281
281
|
requirements:
|
282
|
-
- - "
|
282
|
+
- - ">"
|
283
283
|
- !ruby/object:Gem::Version
|
284
|
-
version:
|
284
|
+
version: 1.3.1
|
285
285
|
requirements: []
|
286
286
|
rubyforge_project:
|
287
287
|
rubygems_version: 2.2.2
|