sensu 0.17.0.beta.1 → 0.17.0.beta.2

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: 23b2db451f31f89aba603541b9d4154bb2cf5ac9
4
- data.tar.gz: 7919b87e10f33dd688538f03ac2f02031c4f88c8
3
+ metadata.gz: 47f5f3a7c52be2c090710bd09728d3169d3d2de9
4
+ data.tar.gz: 7b0eb7d4ba23c1f87b31ee70450eb0e2dbd5f3d9
5
5
  SHA512:
6
- metadata.gz: cdb5f52f14d6260c3dbb60e2a8596c6cdde582f97638b87ebf02e505f2bdb36dcf1f433747ad9aec5ebc87d730459a79344adc0611eb480b891cfe2b59f01ac6
7
- data.tar.gz: 784e7f18dd9c3ebd44926489c8d48410614aa33a422e9cf2abd0492f6b52171b9e599ffcc804e5c8c2bb7771724b69539a02e98801b8588402d28f38a939d42f
6
+ metadata.gz: a34c81ce0909a8b30c729284324a3bef61ce02818a92c6b25df32c94941d96658fb6da88a2a17dfaa0c22b6e54e84ef58473b6440b4db98db5e8b67210f423cc
7
+ data.tar.gz: 19aa55da62e7321ae9f0a88fc646903d3a299827f558ddf4ef05c7ba24a222d9651444c24f03d8f852ebb3546959e44d2983d1c84765eb4f72471dda4450d0c7
data/CHANGELOG.md CHANGED
@@ -11,6 +11,19 @@ Handler output with multiple lines is now logged as a single log event.
11
11
 
12
12
  Support for Sensu filter extensions.
13
13
 
14
+ Check definitions can now specify a Sensu check extension to run,
15
+ "extension", instead of a command.
16
+
17
+ Sensu transport "reconnect_on_error" configuration option, to enable
18
+ transport reconnect in the event of an unexpected error. This is set to
19
+ false by default, as some errors are unrecoverable. The Sensu transport
20
+ will always reconnect when there is a loss of connectivity.
21
+
22
+ Sensu Redis "reconnect_on_error" configuration option, to enable Redis
23
+ reconnect in the event of an unexpected error. This is set to false by
24
+ default, as some errors are unrecoverable. The Redis client will always
25
+ reconnect when there is a loss of connectivity.
26
+
14
27
  ### Other
15
28
 
16
29
  Fixed TLS/SSL on Windows.
@@ -171,7 +171,10 @@ module Sensu
171
171
  # Run a check extension and publish the result. The Sensu client
172
172
  # loads check extensions, checks that run within the Sensu Ruby
173
173
  # VM and the EventMachine event loop, using the Sensu Extension
174
- # API.
174
+ # API. If a check definition includes `:extension`, use it's
175
+ # value for the extension name, otherwise use the check name.
176
+ # The check definition is passed to the extension `safe_run()`
177
+ # method as a parameter, the extension may utilize it.
175
178
  #
176
179
  # https://github.com/sensu/sensu-extension
177
180
  #
@@ -179,8 +182,9 @@ module Sensu
179
182
  def run_check_extension(check)
180
183
  @logger.debug("attempting to run check extension", :check => check)
181
184
  check[:executed] = Time.now.to_i
182
- extension = @extensions[:checks][check[:name]]
183
- extension.safe_run do |output, status|
185
+ extension_name = check[:extension] || check[:name]
186
+ extension = @extensions[:checks][extension_name]
187
+ extension.safe_run(check) do |output, status|
184
188
  check[:output] = output
185
189
  check[:status] = status
186
190
  publish_check_result(check)
@@ -188,14 +192,19 @@ module Sensu
188
192
  end
189
193
 
190
194
  # Process a check request. If a check request has a check
191
- # command, it will be executed. A check request without a check
192
- # command indicates a check extension run. A check request will
193
- # be merged with a local check definition, if present. Client
194
- # safe mode is enforced in this method, requiring a local check
195
+ # command, it will be executed. A standard check request will be
196
+ # merged with a local check definition, if present. Client safe
197
+ # mode is enforced in this method, requiring a local check
195
198
  # definition in order to execute the check command. If a local
196
199
  # check definition does not exist when operating with client
197
200
  # safe mode, a check result will be published to report the
198
- # missing check definition.
201
+ # missing check definition. A check request without a
202
+ # command indicates a check extension run. The check request may
203
+ # contain `:extension`, the name of the extension to run. If
204
+ # `:extension` is not present, the check name is used for the
205
+ # extension name. If a check extension does not exist for a
206
+ # name, a check result will be published to report the unknown
207
+ # check extension.
199
208
  #
200
209
  # @param check [Hash]
201
210
  def process_check_request(check)
@@ -214,7 +223,8 @@ module Sensu
214
223
  execute_check_command(check)
215
224
  end
216
225
  else
217
- if @extensions.check_exists?(check[:name])
226
+ extension_name = check[:extension] || check[:name]
227
+ if @extensions.check_exists?(extension_name)
218
228
  run_check_extension(check)
219
229
  else
220
230
  @logger.warn("unknown check extension", :check => check)
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.17.0.beta.1"
4
+ VERSION = "0.17.0.beta.2"
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown]
data/lib/sensu/daemon.rb CHANGED
@@ -5,9 +5,9 @@ gem "eventmachine", "1.0.3"
5
5
 
6
6
  gem "sensu-em", "2.4.1"
7
7
  gem "sensu-logger", "1.0.0"
8
- gem "sensu-settings", "1.2.0"
8
+ gem "sensu-settings", "1.3.0"
9
9
  gem "sensu-extension", "1.1.2"
10
- gem "sensu-extensions", "1.1.0"
10
+ gem "sensu-extensions", "1.2.0"
11
11
  gem "sensu-transport", "2.4.0"
12
12
  gem "sensu-spawn", "1.1.0"
13
13
 
@@ -185,7 +185,11 @@ module Sensu
185
185
  @transport = Transport.connect(transport_name, transport_settings)
186
186
  @transport.on_error do |error|
187
187
  @logger.fatal("transport connection error", :error => error.to_s)
188
- stop
188
+ if @settings[:transport][:reconnect_on_error]
189
+ @transport.reconnect
190
+ else
191
+ stop
192
+ end
189
193
  end
190
194
  @transport.before_reconnect do
191
195
  unless testing?
data/lib/sensu/redis.rb CHANGED
@@ -1,4 +1,4 @@
1
- gem "em-redis-unified", "0.5.0"
1
+ gem "em-redis-unified", "0.6.0"
2
2
 
3
3
  require "em-redis"
4
4
 
data/sensu.gemspec CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency "eventmachine", "1.0.3"
20
20
  s.add_dependency "sensu-em", "2.4.1"
21
21
  s.add_dependency "sensu-logger", "1.0.0"
22
- s.add_dependency "sensu-settings", "1.2.0"
22
+ s.add_dependency "sensu-settings", "1.3.0"
23
23
  s.add_dependency "sensu-extension", "1.1.2"
24
- s.add_dependency "sensu-extensions", "1.1.0"
24
+ s.add_dependency "sensu-extensions", "1.2.0"
25
25
  s.add_dependency "sensu-transport", "2.4.0"
26
26
  s.add_dependency "sensu-spawn", "1.1.0"
27
- s.add_dependency "em-redis-unified", "0.5.0"
27
+ s.add_dependency "em-redis-unified", "0.6.0"
28
28
  s.add_dependency "sinatra", "1.3.5"
29
29
  s.add_dependency "async_sinatra", "1.0.0"
30
30
  s.add_dependency "thin", "1.5.0" unless RUBY_PLATFORM =~ /java/
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.17.0.beta.1
4
+ version: 0.17.0.beta.2
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: 2015-03-10 00:00:00.000000000 Z
12
+ date: 2015-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: 1.2.0
90
+ version: 1.3.0
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 1.2.0
97
+ version: 1.3.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: sensu-extension
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 1.1.0
118
+ version: 1.2.0
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: 1.1.0
125
+ version: 1.2.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: sensu-transport
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -157,14 +157,14 @@ dependencies:
157
157
  requirements:
158
158
  - - '='
159
159
  - !ruby/object:Gem::Version
160
- version: 0.5.0
160
+ version: 0.6.0
161
161
  type: :runtime
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - '='
166
166
  - !ruby/object:Gem::Version
167
- version: 0.5.0
167
+ version: 0.6.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: sinatra
170
170
  requirement: !ruby/object:Gem::Requirement