sensu-plugin 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sensu-handler.rb +7 -0
- data/lib/sensu-plugin.rb +1 -1
- data/lib/sensu-plugin/utils.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b8bf9dc7a64cb5b2a2359146d1d8cfa747fc8e6
|
4
|
+
data.tar.gz: 52223d03497178da064f55e89e307d1ab86dfef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d698f30f72883a2024bb7096c14cc42ec4fa740a12e337c7903018b76b2e30444030fe907b8dc962d3f2a87c2dac6fc08b2400ec00fb36d84d9f0f4d83a654f5
|
7
|
+
data.tar.gz: 5768eb08725dc2f4d723a2dc367587854f108082c08804fa6679982fd70ce684fcbb4f1f8867171a27cff6119ff94d1015594162ccdd465d619edec46f8eef13
|
data/lib/sensu-handler.rb
CHANGED
@@ -76,6 +76,9 @@ module Sensu
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def api_request(method, path, &blk)
|
79
|
+
if not settings.has_key?('api')
|
80
|
+
raise "api.json settings not found."
|
81
|
+
end
|
79
82
|
http = Net::HTTP.new(settings['api']['host'], settings['api']['port'])
|
80
83
|
req = net_http_req_class(method).new(path)
|
81
84
|
if settings['api']['user'] && settings['api']['password']
|
@@ -133,6 +136,8 @@ module Sensu
|
|
133
136
|
bail scope + ' alerts silenced'
|
134
137
|
end
|
135
138
|
end
|
139
|
+
rescue Errno::ECONNREFUSED
|
140
|
+
puts 'connection refused attempting to query the sensu api for a stash'
|
136
141
|
rescue Timeout::Error
|
137
142
|
puts 'timed out while attempting to query the sensu api for a stash'
|
138
143
|
end
|
@@ -154,6 +159,8 @@ module Sensu
|
|
154
159
|
bail 'check dependency event exists'
|
155
160
|
end
|
156
161
|
end
|
162
|
+
rescue Errno::ECONNREFUSED
|
163
|
+
puts 'connection refused attempting to query the sensu api for an event'
|
157
164
|
rescue Timeout::Error
|
158
165
|
puts 'timed out while attempting to query the sensu api for an event'
|
159
166
|
end
|
data/lib/sensu-plugin.rb
CHANGED
data/lib/sensu-plugin/utils.rb
CHANGED
@@ -3,7 +3,9 @@ module Sensu
|
|
3
3
|
module Utils
|
4
4
|
|
5
5
|
def config_files
|
6
|
-
if ENV['
|
6
|
+
if ENV['SENSU_LOADED_TEMPFILE']
|
7
|
+
IO.read(ENV['SENSU_LOADED_TEMPFILE']).split(':')
|
8
|
+
elsif ENV['SENSU_CONFIG_FILES']
|
7
9
|
ENV['SENSU_CONFIG_FILES'].split(':')
|
8
10
|
else
|
9
11
|
['/etc/sensu/config.json'] + Dir['/etc/sensu/conf.d/**/*.json']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Decklin Foster
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|