sensu-plugins-outlyer 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -1
- data/README.md +7 -1
- data/bin/outlyer-metrics.rb +14 -7
- data/lib/sensu-plugins-outlyer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c721feb36be4a20c84e87e8f9daf5b35188bc9a
|
4
|
+
data.tar.gz: cd97e673f4e833081e5890290284d2ff1a8ee3ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19feb700741fae9aa6aa7499d52134167127beeef89c88dc1d2b85b98ccaf1e42b9ee55683313ce8dcca6693e091a3e48e99c0ee7a92dad8e7e8d962e52243b
|
7
|
+
data.tar.gz: 4bd132161944134bb7fa6c8fe7dfb57f1646e9a7ee7ae63920ac14d5081857332dedfae256233fbbedc69a4b3308ed4dc9b3206181fdde5d256b2e5558af9c0b
|
data/CHANGELOG.md
CHANGED
@@ -3,9 +3,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
|
-
## [0.
|
6
|
+
## [0.10.0] - 2018-07-18
|
7
7
|
- Added `source:sensu` label to metrics
|
8
8
|
- Fixed bug with Nagios parsing
|
9
|
+
- Fixed handling checks that send message, not Graphite metrics
|
9
10
|
|
10
11
|
## [0.7.0] - 2018-07-16
|
11
12
|
- Made debug flag boolean
|
data/README.md
CHANGED
@@ -33,8 +33,14 @@ Ensure your handler has execution permissions set:
|
|
33
33
|
chmod +x ./bin/outlyer-metrics.rb
|
34
34
|
```
|
35
35
|
|
36
|
-
|
36
|
+
To run all the unit tests:
|
37
37
|
|
38
38
|
```bash
|
39
39
|
ruby test/test_outlyer_handler.rb
|
40
40
|
```
|
41
|
+
|
42
|
+
To run a specific unit test:
|
43
|
+
|
44
|
+
```bash
|
45
|
+
ruby -I test test/test_outlyer_handler.rb -n <test_name>
|
46
|
+
```
|
data/bin/outlyer-metrics.rb
CHANGED
@@ -207,8 +207,19 @@ class OutlyerMetrics < Sensu::Handler
|
|
207
207
|
end
|
208
208
|
if config[:debug]
|
209
209
|
puts "Parsed #{data.length} of #{output.split("\n").length} metrics"
|
210
|
-
end
|
211
|
-
|
210
|
+
end
|
211
|
+
|
212
|
+
# Handle scenario where output was not valid Graphite output
|
213
|
+
if data.length == 0 && @event['check']['status'].to_i > 0
|
214
|
+
# Happens when check is mis-configured and outputs error message
|
215
|
+
# Treat as UNKNOWN status
|
216
|
+
puts "Output is not Graphite format for check '#{@check_name}' "\
|
217
|
+
"on the Sensu client '#{@host}'. Returning UNKNOWN status. Output: \n"\
|
218
|
+
"#{output}"
|
219
|
+
data.push(create_status_metric(3))
|
220
|
+
else
|
221
|
+
data.push(create_status_metric(@event['check']['status'].to_f, metric_host))
|
222
|
+
end
|
212
223
|
data
|
213
224
|
end
|
214
225
|
|
@@ -230,11 +241,7 @@ class OutlyerMetrics < Sensu::Handler
|
|
230
241
|
service: sanitize_value(@check_name),
|
231
242
|
source: 'sensu'
|
232
243
|
}
|
233
|
-
|
234
|
-
if config[:debug]
|
235
|
-
puts "Created status datapoint with properties #{point}"
|
236
|
-
end
|
237
|
-
point
|
244
|
+
create_datapoint('service.status', check_status, timestamp, labels, hostname)
|
238
245
|
end
|
239
246
|
|
240
247
|
# Ensures all label values conform to Outlyer's data format requirements:
|