sensu 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +20 -1
- data/lib/sensu/base.rb +4 -2
- data/lib/sensu/cli.rb +2 -2
- data/lib/sensu/client.rb +1 -1
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/extensions.rb +10 -0
- data/lib/sensu/io.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
## 0.10.1 - 2013-07-17
|
2
|
+
|
3
|
+
### Features
|
4
|
+
|
5
|
+
You can specify multiple Sensu service configuration directories,
|
6
|
+
using the -d (--config_dir) CLI argument, providing a comma delimited
|
7
|
+
list.
|
8
|
+
|
9
|
+
A post initialize hook ("post_init()") was added to the extension API,
|
10
|
+
enabling setup (connections, etc.) within the event loop.
|
11
|
+
|
12
|
+
### Other
|
13
|
+
|
14
|
+
Catches nil exit statuses, returned from check execution.
|
15
|
+
|
16
|
+
Empty command token substitution defaults now work. eg. "-f :::bar|:::"
|
17
|
+
|
18
|
+
Specs updated to run on OS X, bash compatibility.
|
19
|
+
|
1
20
|
## 0.10.0 - 2013-06-27
|
2
21
|
|
3
22
|
### Non-backwards compatible changes
|
@@ -8,7 +27,7 @@ The valid characters are: a-z, A-Z, 0-9, "_", ".", and "-".
|
|
8
27
|
"command_executed" was removed from check results, as it may contain
|
9
28
|
sensitive information, such as credentials.
|
10
29
|
|
11
|
-
###
|
30
|
+
### Features
|
12
31
|
|
13
32
|
Passwords in client data (keepalives) and log events are replaced with
|
14
33
|
"REDACTED", reducing the possibility of exposure. The following
|
data/lib/sensu/base.rb
CHANGED
@@ -43,8 +43,10 @@ module Sensu
|
|
43
43
|
if @options[:config_file]
|
44
44
|
settings.load_file(@options[:config_file])
|
45
45
|
end
|
46
|
-
if @options[:
|
47
|
-
|
46
|
+
if @options[:config_dirs]
|
47
|
+
@options[:config_dirs].each do |config_dir|
|
48
|
+
settings.load_directory(config_dir)
|
49
|
+
end
|
48
50
|
end
|
49
51
|
settings.validate
|
50
52
|
settings.set_env
|
data/lib/sensu/cli.rb
CHANGED
@@ -16,8 +16,8 @@ module Sensu
|
|
16
16
|
opts.on('-c', '--config FILE', 'Sensu JSON config FILE') do |file|
|
17
17
|
options[:config_file] = file
|
18
18
|
end
|
19
|
-
opts.on('-d', '--config_dir DIR', 'DIR for Sensu JSON config files') do |dir|
|
20
|
-
options[:
|
19
|
+
opts.on('-d', '--config_dir DIR[,DIR]', 'DIR or comma-delimited DIR list for Sensu JSON config files') do |dir|
|
20
|
+
options[:config_dirs] = dir.split(',')
|
21
21
|
end
|
22
22
|
opts.on('-e', '--extension_dir DIR', 'DIR for Sensu extensions') do |dir|
|
23
23
|
options[:extension_dir] = dir
|
data/lib/sensu/client.rb
CHANGED
@@ -79,7 +79,7 @@ module Sensu
|
|
79
79
|
def substitute_command_tokens(check)
|
80
80
|
unmatched_tokens = Array.new
|
81
81
|
substituted = check[:command].gsub(/:::(.*?):::/) do
|
82
|
-
token, default = $1.to_s.split('|')
|
82
|
+
token, default = $1.to_s.split('|', -1)
|
83
83
|
matched = token.split('.').inject(@settings[:client]) do |client, attribute|
|
84
84
|
if client[attribute].nil?
|
85
85
|
default.nil? ? break : default
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/extensions.rb
CHANGED
@@ -85,6 +85,12 @@ module Sensu
|
|
85
85
|
|
86
86
|
module Extension
|
87
87
|
class Base
|
88
|
+
def initialize
|
89
|
+
EM::next_tick do
|
90
|
+
post_init
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
88
94
|
def name
|
89
95
|
'base'
|
90
96
|
end
|
@@ -108,6 +114,10 @@ module Sensu
|
|
108
114
|
definition.has_key?(key.to_sym)
|
109
115
|
end
|
110
116
|
|
117
|
+
def post_init
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
111
121
|
def run(event=nil, settings={}, &block)
|
112
122
|
block.call('noop', 0)
|
113
123
|
end
|
data/lib/sensu/io.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 1
|
10
|
+
version: 0.10.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Porter
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-
|
19
|
+
date: 2013-07-17 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|