sensu 0.13.0.alpha.2 → 0.13.0.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 791f89558873702eb221fd48783c9c10c058e26f
4
- data.tar.gz: e7a4e93caced70dc3dd5b93d29815f018c4634ee
3
+ metadata.gz: fb0b42351e78060c0d98db18dab7eda10d3454bb
4
+ data.tar.gz: d0427f69c4aa2ff78df74388c8fe25db2d4bda37
5
5
  SHA512:
6
- metadata.gz: f1adae9a398a3de29d65bc5c08e6cd3a53ebb1653896d21497d57857baaa19c3ef4a0fbf5d4d9d43c57274455f72bb757ce3abcfd9750f8e8b2689ea3c5c24d3
7
- data.tar.gz: 644e45b48c17137c43c8c6447f750b4a6a2f97c38e71ced938184d36b071348f0bea72114fa4cf628bb917a9826ffbf90af976950441221913fdf0334518aa17
6
+ metadata.gz: c018ea24b885b250bd4c34ccadc1b5a96e02c43eaf5ee9671042afb5c4f8d59312ba9ec90477eb69c2161cb20afebdc643fa1f846d78a66bcd5c33f50bfdc55a
7
+ data.tar.gz: 2556a259aff1f186d6dc1aa1c61d5799da2bfc88bda700f531b1c52656b67c45b082a777d92cee35971da2b767a5333eeee7238e5e44e57c6dad8053b204c0b5
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
 
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.13.0.alpha.2'
3
+ VERSION = '0.13.0.beta'
4
4
 
5
5
  SEVERITIES = %w[ok warning critical unknown]
6
6
 
data/lib/sensu/daemon.rb CHANGED
@@ -4,10 +4,10 @@ gem 'multi_json', '1.10.1'
4
4
 
5
5
  gem 'sensu-em', '2.0.0'
6
6
  gem 'sensu-logger', '0.0.1'
7
- gem 'sensu-settings', '0.0.5'
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.2'
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
- if @settings[:transport].is_a?(Hash)
127
- transport_name = @settings[:transport][:name]
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.info('bridge extension output', {
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 >= 60
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(20) do
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(&block)
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
- if @redis.connected?
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 do
733
- @state = :paused
734
- if block
735
- block.call
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
@@ -4,7 +4,7 @@ require File.join(File.dirname(__FILE__), 'lib', 'sensu', 'constants')
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'sensu'
6
6
  s.version = Sensu::VERSION
7
- s.platform = Gem::Platform::RUBY
7
+ s.platform = RUBY_PLATFORM =~ /java/ ? Gem::Platform::JAVA : Gem::Platform::RUBY
8
8
  s.authors = ['Sean Porter', 'Justin Kolberg']
9
9
  s.email = ['portertech@gmail.com', 'justin.kolberg@sonian.net']
10
10
  s.homepage = 'https://github.com/sensu/sensu'
@@ -18,10 +18,10 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency('uuidtools', '2.1.4')
19
19
  s.add_dependency('sensu-em', '2.0.0')
20
20
  s.add_dependency('sensu-logger', '0.0.1')
21
- s.add_dependency('sensu-settings', '0.0.5')
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.2')
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.alpha.2
4
+ version: 0.13.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: 2014-05-27 00:00:00.000000000 Z
12
+ date: 2014-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.0.5
76
+ version: 0.0.7
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 0.0.5
83
+ version: 0.0.7
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: sensu-extension
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.0.2
118
+ version: 0.0.6
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: 0.0.2
125
+ version: 0.0.6
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: sensu-spawn
128
128
  requirement: !ruby/object:Gem::Requirement