sensu 0.13.0.alpha.2-java → 0.13.0.beta.1-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 +4 -1
- data/lib/sensu/client.rb +11 -8
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/daemon.rb +6 -9
- data/lib/sensu/server.rb +10 -30
- data/sensu.gemspec +3 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b5f28dcc77e1d930eb8e71d6a7907eb36aa32c
|
4
|
+
data.tar.gz: 50303ac9338607ee19dd12e9d8e1f3f084bb6b25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d745900be3449d1b5a63f36e5d5c8a088386b85bad15baa50ee88df3fcf7d54112165a593598ccc6dccff51759c91014f209789b172d73c061c5ab5f2e361a
|
7
|
+
data.tar.gz: 0476381bb4114bdc7d6332ce279eab2fa226245c9aee39c1cf273bfe5b8940949c3a774c36c417b858c8ad5500d30f02f1cac940d33f595be910a41a1be4ec84
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
API GET /events now provides all event data, the same data passed to event
|
6
6
|
handlers.
|
7
7
|
|
8
|
+
AMQP handler type ("amqp") has been replaced by "transport".
|
9
|
+
|
8
10
|
Standalone check results are no longer merged with check definitions
|
9
11
|
residing on the server(s).
|
10
12
|
|
@@ -30,7 +32,8 @@ everything but check extensions.
|
|
30
32
|
|
31
33
|
Fixed standalone check scheduling, no longer mutating definitions.
|
32
34
|
|
33
|
-
Fixed command token substitution, allowing for the use of colons
|
35
|
+
Fixed command token substitution, allowing for the use of colons and
|
36
|
+
working value defaults.
|
34
37
|
|
35
38
|
Log events are flushed when the eventmachine reactor stops.
|
36
39
|
|
data/lib/sensu/client.rb
CHANGED
@@ -68,17 +68,20 @@ module Sensu
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def find_client_attribute(tree, path, default)
|
72
|
+
attribute = tree[path.shift]
|
73
|
+
if attribute.is_a?(Hash)
|
74
|
+
find_client_attribute(attribute, path, default)
|
75
|
+
else
|
76
|
+
attribute.nil? ? default : attribute
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
71
80
|
def substitute_command_tokens(check)
|
72
81
|
unmatched_tokens = Array.new
|
73
|
-
substituted = check[:command].gsub(/:::([^:]
|
82
|
+
substituted = check[:command].gsub(/:::([^:].*?):::/) do
|
74
83
|
token, default = $1.to_s.split('|', -1)
|
75
|
-
matched = token.split('.')
|
76
|
-
if client[attribute].nil?
|
77
|
-
default.nil? ? break : default
|
78
|
-
else
|
79
|
-
client[attribute]
|
80
|
-
end
|
81
|
-
end
|
84
|
+
matched = find_client_attribute(@settings[:client], token.split('.'), default)
|
82
85
|
if matched.nil?
|
83
86
|
unmatched_tokens << token
|
84
87
|
end
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/daemon.rb
CHANGED
@@ -2,12 +2,12 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
gem 'multi_json', '1.10.1'
|
4
4
|
|
5
|
-
gem 'sensu-em', '2.
|
5
|
+
gem 'sensu-em', '2.1.0'
|
6
6
|
gem 'sensu-logger', '0.0.1'
|
7
|
-
gem 'sensu-settings', '0.0.
|
7
|
+
gem 'sensu-settings', '0.0.7'
|
8
8
|
gem 'sensu-extension', '0.0.3'
|
9
9
|
gem 'sensu-extensions', '0.0.5'
|
10
|
-
gem 'sensu-transport', '0.0.
|
10
|
+
gem 'sensu-transport', '0.0.6'
|
11
11
|
gem 'sensu-spawn', '0.0.3'
|
12
12
|
|
13
13
|
require 'time'
|
@@ -123,17 +123,14 @@ module Sensu
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def setup_transport
|
126
|
-
|
127
|
-
|
128
|
-
end
|
129
|
-
transport_name ||= 'rabbitmq'
|
130
|
-
transport_settings = @settings[transport_name.to_sym]
|
126
|
+
transport_name = @settings[:transport][:name] || 'rabbitmq'
|
127
|
+
transport_settings = @settings[transport_name]
|
131
128
|
@logger.debug('connecting to transport', {
|
132
129
|
:name => transport_name,
|
133
130
|
:settings => transport_settings
|
134
131
|
})
|
132
|
+
Transport.logger = @logger
|
135
133
|
@transport = Transport.connect(transport_name, transport_settings)
|
136
|
-
@transport.logger = @logger
|
137
134
|
@transport.on_error do |error|
|
138
135
|
@logger.fatal('transport connection error', {
|
139
136
|
:error => error.to_s
|
data/lib/sensu/server.rb
CHANGED
@@ -340,7 +340,7 @@ module Sensu
|
|
340
340
|
@extensions[:bridges].each do |name, bridge|
|
341
341
|
bridge.safe_run(event) do |output, status|
|
342
342
|
output.each_line do |line|
|
343
|
-
@logger.
|
343
|
+
@logger.debug('bridge extension output', {
|
344
344
|
:extension => bridge.definition,
|
345
345
|
:output => line
|
346
346
|
})
|
@@ -632,7 +632,7 @@ module Sensu
|
|
632
632
|
master_duties
|
633
633
|
else
|
634
634
|
@redis.get('lock:master') do |timestamp|
|
635
|
-
if Time.now.to_i - timestamp.to_i >=
|
635
|
+
if Time.now.to_i - timestamp.to_i >= 30
|
636
636
|
@redis.getset('lock:master', Time.now.to_i) do |previous|
|
637
637
|
if previous == timestamp
|
638
638
|
@is_master = true
|
@@ -648,7 +648,7 @@ module Sensu
|
|
648
648
|
|
649
649
|
def setup_master_monitor
|
650
650
|
request_master_election
|
651
|
-
@timers[:run] << EM::PeriodicTimer.new(
|
651
|
+
@timers[:run] << EM::PeriodicTimer.new(10) do
|
652
652
|
if @is_master
|
653
653
|
@redis.set('lock:master', Time.now.to_i) do
|
654
654
|
@logger.debug('updated master lock timestamp')
|
@@ -659,35 +659,16 @@ module Sensu
|
|
659
659
|
end
|
660
660
|
end
|
661
661
|
|
662
|
-
def resign_as_master
|
663
|
-
block ||= Proc.new {}
|
662
|
+
def resign_as_master
|
664
663
|
if @is_master
|
665
664
|
@logger.warn('resigning as master')
|
666
665
|
@timers[:master].each do |timer|
|
667
666
|
timer.cancel
|
668
667
|
end
|
669
668
|
@timers[:master].clear
|
670
|
-
|
671
|
-
@redis.del('lock:master') do
|
672
|
-
@logger.info('removed master lock')
|
673
|
-
@is_master = false
|
674
|
-
end
|
675
|
-
end
|
676
|
-
timestamp = Time.now.to_i
|
677
|
-
retry_until_true do
|
678
|
-
if !@is_master
|
679
|
-
block.call
|
680
|
-
true
|
681
|
-
elsif Time.now.to_i - timestamp >= 3
|
682
|
-
@logger.warn('failed to remove master lock')
|
683
|
-
@is_master = false
|
684
|
-
block.call
|
685
|
-
true
|
686
|
-
end
|
687
|
-
end
|
669
|
+
@is_master = false
|
688
670
|
else
|
689
671
|
@logger.debug('not currently master')
|
690
|
-
block.call
|
691
672
|
end
|
692
673
|
end
|
693
674
|
|
@@ -729,11 +710,10 @@ module Sensu
|
|
729
710
|
end
|
730
711
|
@timers[:run].clear
|
731
712
|
unsubscribe
|
732
|
-
resign_as_master
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
end
|
713
|
+
resign_as_master
|
714
|
+
@state = :paused
|
715
|
+
if block
|
716
|
+
block.call
|
737
717
|
end
|
738
718
|
end
|
739
719
|
end
|
@@ -751,8 +731,8 @@ module Sensu
|
|
751
731
|
|
752
732
|
def stop
|
753
733
|
@logger.warn('stopping')
|
754
|
-
@state = :stopping
|
755
734
|
pause do
|
735
|
+
@state = :stopping
|
756
736
|
complete_handlers_in_progress do
|
757
737
|
@redis.close
|
758
738
|
@transport.close
|
data/sensu.gemspec
CHANGED
@@ -16,12 +16,12 @@ 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.
|
19
|
+
s.add_dependency('sensu-em', '2.1.0')
|
20
20
|
s.add_dependency('sensu-logger', '0.0.1')
|
21
|
-
s.add_dependency('sensu-settings', '0.0.
|
21
|
+
s.add_dependency('sensu-settings', '0.0.7')
|
22
22
|
s.add_dependency('sensu-extension', '0.0.3')
|
23
23
|
s.add_dependency('sensu-extensions', '0.0.5')
|
24
|
-
s.add_dependency('sensu-transport', '0.0.
|
24
|
+
s.add_dependency('sensu-transport', '0.0.6')
|
25
25
|
s.add_dependency('sensu-spawn', '0.0.3')
|
26
26
|
s.add_dependency('em-redis-unified', '0.5.0')
|
27
27
|
s.add_dependency('sinatra', '1.3.5')
|
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.13.0.
|
4
|
+
version: 0.13.0.beta.1
|
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: 2014-05-
|
12
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -45,12 +45,12 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 2.
|
48
|
+
version: 2.1.0
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: 2.1.0
|
54
54
|
prerelease: false
|
55
55
|
type: :runtime
|
56
56
|
- !ruby/object:Gem::Dependency
|
@@ -73,12 +73,12 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.0.
|
76
|
+
version: 0.0.7
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - '='
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.0.
|
81
|
+
version: 0.0.7
|
82
82
|
prerelease: false
|
83
83
|
type: :runtime
|
84
84
|
- !ruby/object:Gem::Dependency
|
@@ -115,12 +115,12 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.0.
|
118
|
+
version: 0.0.6
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - '='
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0.0.
|
123
|
+
version: 0.0.6
|
124
124
|
prerelease: false
|
125
125
|
type: :runtime
|
126
126
|
- !ruby/object:Gem::Dependency
|