sensu 0.13.0.beta-java → 0.13.0-java

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: 03bb8aada8fc109d81e0b691877050914ccf1175
4
- data.tar.gz: f5f1d156a7c084d120f531be643d5919ce357cfc
3
+ metadata.gz: 9d379ef4e0836c0a4bd83693fd1b2c56f2bd812e
4
+ data.tar.gz: ab189afb5a1f15166596b52ed60f142a96c396dd
5
5
  SHA512:
6
- metadata.gz: d5b66d46dcba00c31be02e6e7dadd42657a248073ada1a611f558f65b94f522ae801987987f6aab6840630e6b4a5dad11cab015f65c3c4af1d7c0c8866dd0c8d
7
- data.tar.gz: 1fd75e24c411a8c0399c59a9cb5b90b248096c18e871a8a25bd1298e9ecf4756ad43e77322f8e674b69f2025c162e8645ca378a10114fbfa98648fa343c716dc
6
+ metadata.gz: 782fdd8d034188b6c3c01637637fbf433ae20d31f6d87661a27e87962a613b582c58284e746b9aaf04ba0cc0f2cc91a6dfbc0362c09bb1886f80b0c5a2dff962
7
+ data.tar.gz: 4330232415934cae548c7673d8e3750757c16762a69df952dea94db86dcb9c5d0777b43098749dbc1b3cab0293e08d10ee52ce168c25300c94cee6becfef34e0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 0.13.0 - TBD
1
+ ## 0.13.0 - 2014-06-12
2
2
 
3
3
  ### Non-backwards compatible changes
4
4
 
@@ -25,6 +25,10 @@ services.
25
25
 
26
26
  Client keepalives now contain the Sensu version.
27
27
 
28
+ Support for nested handler sets (not deep).
29
+
30
+ Setting validation reports all invalid definitions before Sensu exits.
31
+
28
32
  ### Other
29
33
 
30
34
  Clients now only load instances of check extensions, and servers load
@@ -32,7 +36,8 @@ everything but check extensions.
32
36
 
33
37
  Fixed standalone check scheduling, no longer mutating definitions.
34
38
 
35
- Fixed command token substitution, allowing for the use of colons.
39
+ Fixed command token substitution, allowing for the use of colons and
40
+ working value defaults.
36
41
 
37
42
  Log events are flushed when the eventmachine reactor stops.
38
43
 
@@ -41,6 +46,8 @@ Dropped the Oj JSON parser, heap allocation issues and memory leaks.
41
46
  Client RabbitMQ queues are no longer server named (bugs), they are now
42
47
  composed of the client name, Sensu version, and the timestamp at creation.
43
48
 
49
+ Server master election lock updates and queries are more frequent.
50
+
44
51
  ## 0.12.6 - 2014-02-19
45
52
 
46
53
  ### Non-backwards compatible changes
data/MIT-LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Sonian Inc.
1
+ Copyright (c) 2014 Sonian Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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(/:::([^:]*?):::/) do
82
+ substituted = check[:command].gsub(/:::([^:].*?):::/) do
74
83
  token, default = $1.to_s.split('|', -1)
75
- matched = token.split('.').inject(@settings[:client]) do |client, attribute|
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
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.13.0.beta'
3
+ VERSION = '0.13.0'
4
4
 
5
5
  SEVERITIES = %w[ok warning critical unknown]
6
6
 
data/lib/sensu/daemon.rb CHANGED
@@ -2,13 +2,13 @@ require 'rubygems'
2
2
 
3
3
  gem 'multi_json', '1.10.1'
4
4
 
5
- gem 'sensu-em', '2.0.0'
6
- gem 'sensu-logger', '0.0.1'
7
- gem 'sensu-settings', '0.0.7'
8
- gem 'sensu-extension', '0.0.3'
9
- gem 'sensu-extensions', '0.0.5'
10
- gem 'sensu-transport', '0.0.6'
11
- gem 'sensu-spawn', '0.0.3'
5
+ gem 'sensu-em', '2.4.0'
6
+ gem 'sensu-logger', '1.0.0'
7
+ gem 'sensu-settings', '1.0.0'
8
+ gem 'sensu-extension', '1.0.0'
9
+ gem 'sensu-extensions', '1.0.0'
10
+ gem 'sensu-transport', '1.0.0'
11
+ gem 'sensu-spawn', '1.0.0'
12
12
 
13
13
  require 'time'
14
14
  require 'uri'
data/lib/sensu/server.rb CHANGED
@@ -116,12 +116,18 @@ module Sensu
116
116
  end
117
117
  end
118
118
 
119
- def derive_handlers(handler_list)
119
+ def derive_handlers(handler_list, depth=0)
120
120
  handler_list.compact.inject(Array.new) do |handlers, handler_name|
121
121
  if @settings.handler_exists?(handler_name)
122
122
  handler = @settings[:handlers][handler_name].merge(:name => handler_name)
123
123
  if handler[:type] == 'set'
124
- handlers = handlers + derive_handlers(handler[:handlers])
124
+ if depth < 2
125
+ handlers = handlers + derive_handlers(handler[:handlers], depth + 1)
126
+ else
127
+ @logger.error('handler sets cannot be deeply nested', {
128
+ :handler => handler
129
+ })
130
+ end
125
131
  else
126
132
  handlers << handler
127
133
  end
@@ -537,17 +543,21 @@ module Sensu
537
543
 
538
544
  def determine_stale_clients
539
545
  @logger.info('determining stale clients')
546
+ keepalive_check = {
547
+ :thresholds => {
548
+ :warning => 120,
549
+ :critical => 180
550
+ }
551
+ }
552
+ if @settings.handler_exists?(:keepalive)
553
+ keepalive_check[:handler] = "keepalive"
554
+ end
540
555
  @redis.smembers('clients') do |clients|
541
556
  clients.each do |client_name|
542
557
  @redis.get('client:' + client_name) do |client_json|
543
558
  unless client_json.nil?
544
559
  client = MultiJson.load(client_json)
545
- check = {
546
- :thresholds => {
547
- :warning => 120,
548
- :critical => 180
549
- }
550
- }
560
+ check = keepalive_check.dup
551
561
  if client.has_key?(:keepalive)
552
562
  check = deep_merge(check, client[:keepalive])
553
563
  end
data/sensu.gemspec CHANGED
@@ -9,20 +9,20 @@ Gem::Specification.new do |s|
9
9
  s.email = ['portertech@gmail.com', 'justin.kolberg@sonian.net']
10
10
  s.homepage = 'https://github.com/sensu/sensu'
11
11
  s.summary = 'A monitoring framework'
12
- s.description = 'A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.'
12
+ s.description = 'A monitoring framework that aims to be simple, malleable, and scalable.'
13
13
  s.license = 'MIT'
14
14
  s.has_rdoc = false
15
15
 
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.0.0')
20
- s.add_dependency('sensu-logger', '0.0.1')
21
- s.add_dependency('sensu-settings', '0.0.7')
22
- s.add_dependency('sensu-extension', '0.0.3')
23
- s.add_dependency('sensu-extensions', '0.0.5')
24
- s.add_dependency('sensu-transport', '0.0.6')
25
- s.add_dependency('sensu-spawn', '0.0.3')
19
+ s.add_dependency('sensu-em', '2.4.0')
20
+ s.add_dependency('sensu-logger', '1.0.0')
21
+ s.add_dependency('sensu-settings', '1.0.0')
22
+ s.add_dependency('sensu-extension', '1.0.0')
23
+ s.add_dependency('sensu-extensions', '1.0.0')
24
+ s.add_dependency('sensu-transport', '1.0.0')
25
+ s.add_dependency('sensu-spawn', '1.0.0')
26
26
  s.add_dependency('em-redis-unified', '0.5.0')
27
27
  s.add_dependency('sinatra', '1.3.5')
28
28
  s.add_dependency('async_sinatra', '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.13.0.beta
4
+ version: 0.13.0
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-28 00:00:00.000000000 Z
12
+ date: 2014-06-13 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.0.0
48
+ version: 2.4.0
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.0.0
53
+ version: 2.4.0
54
54
  prerelease: false
55
55
  type: :runtime
56
56
  - !ruby/object:Gem::Dependency
@@ -59,12 +59,12 @@ dependencies:
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 0.0.1
62
+ version: 1.0.0
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 0.0.1
67
+ version: 1.0.0
68
68
  prerelease: false
69
69
  type: :runtime
70
70
  - !ruby/object:Gem::Dependency
@@ -73,12 +73,12 @@ dependencies:
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.0.7
76
+ version: 1.0.0
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 0.0.7
81
+ version: 1.0.0
82
82
  prerelease: false
83
83
  type: :runtime
84
84
  - !ruby/object:Gem::Dependency
@@ -87,12 +87,12 @@ dependencies:
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: 0.0.3
90
+ version: 1.0.0
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 0.0.3
95
+ version: 1.0.0
96
96
  prerelease: false
97
97
  type: :runtime
98
98
  - !ruby/object:Gem::Dependency
@@ -101,12 +101,12 @@ dependencies:
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: 0.0.5
104
+ version: 1.0.0
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 0.0.5
109
+ version: 1.0.0
110
110
  prerelease: false
111
111
  type: :runtime
112
112
  - !ruby/object:Gem::Dependency
@@ -115,12 +115,12 @@ dependencies:
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.0.6
118
+ version: 1.0.0
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 0.0.6
123
+ version: 1.0.0
124
124
  prerelease: false
125
125
  type: :runtime
126
126
  - !ruby/object:Gem::Dependency
@@ -129,12 +129,12 @@ dependencies:
129
129
  requirements:
130
130
  - - '='
131
131
  - !ruby/object:Gem::Version
132
- version: 0.0.3
132
+ version: 1.0.0
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - '='
136
136
  - !ruby/object:Gem::Version
137
- version: 0.0.3
137
+ version: 1.0.0
138
138
  prerelease: false
139
139
  type: :runtime
140
140
  - !ruby/object:Gem::Dependency
@@ -221,7 +221,7 @@ dependencies:
221
221
  version: '0'
222
222
  prerelease: false
223
223
  type: :development
224
- description: A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.
224
+ description: A monitoring framework that aims to be simple, malleable, and scalable.
225
225
  email:
226
226
  - portertech@gmail.com
227
227
  - justin.kolberg@sonian.net
@@ -265,9 +265,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  requirements:
268
- - - '>'
268
+ - - '>='
269
269
  - !ruby/object:Gem::Version
270
- version: 1.3.1
270
+ version: '0'
271
271
  requirements: []
272
272
  rubyforge_project:
273
273
  rubygems_version: 2.2.2