sensu-plugins-outlyer 0.9.0 → 0.10.0

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: 00e6cf84c928223961b1c067386b24560ad898c3
4
- data.tar.gz: 66768c9f5f7500b47caa5b7e7d759634a93bbc4f
3
+ metadata.gz: 9c721feb36be4a20c84e87e8f9daf5b35188bc9a
4
+ data.tar.gz: cd97e673f4e833081e5890290284d2ff1a8ee3ac
5
5
  SHA512:
6
- metadata.gz: 5c55c068f0d9710beea2a1bf1d0b5ca9be2fe66fba39eac687e79a753a879241cae83196839c486105f0c92a315b76a1532adad229055a70befc7da95ba340a9
7
- data.tar.gz: 9b0fa05ac20330bc11bcb2ad725844350e8e3dc049be0bb688a64592071ba50aa1f4acbc470c34afcb7ba1d2334fc664b0011712162f22cd03994e687f4bc8e6
6
+ metadata.gz: a19feb700741fae9aa6aa7499d52134167127beeef89c88dc1d2b85b98ccaf1e42b9ee55683313ce8dcca6693e091a3e48e99c0ee7a92dad8e7e8d962e52243b
7
+ data.tar.gz: 4bd132161944134bb7fa6c8fe7dfb57f1646e9a7ee7ae63920ac14d5081857332dedfae256233fbbedc69a4b3308ed4dc9b3206181fdde5d256b2e5558af9c0b
@@ -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.9.0] - 2018-07-18
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
- The run the unit tests:
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
+ ```
@@ -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
- data.push(create_status_metric(@event['check']['status'].to_f, metric_host))
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
- point = create_datapoint('service.status', check_status, timestamp, labels, hostname)
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:
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsOutlyer
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 9
4
+ MINOR = 10
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-outlyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dataloop Software, INC. Trading as Outlyer