sensu-plugins-outlyer 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/bin/outlyer-metrics.rb +9 -6
- data/lib/sensu-plugins-outlyer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b0ed94d0467ef520453c752e6e826c9a698303e3
|
4
|
+
data.tar.gz: 3d8a2558a51d4db142df3019bd36299c7a7ce5cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aafa1c88a6c0dd5075bbc6a3bf44f24d93bc50b094fce91f042be39f4dfa51c7672b16927c91110312da879ec04546ceef4c3f0304c2cec0f7a99b9a14eb7c4
|
7
|
+
data.tar.gz: f528a0d4fbcaa5c2a1aa792649dc79fef52d021a2535090563bc2e8c9e1a0beaa2045a5e6e373a6842d0f7ba6494f7eb9d6b249fd99d9359ae5bbe3e3c99a8dc
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +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.8.0] - 2018-07-18
|
7
|
+
- Added `source:sensu` label to `service.status` metric
|
8
|
+
- Fixed bug with Nagios parsing
|
9
|
+
|
6
10
|
## [0.7.0] - 2018-07-16
|
7
11
|
- Made debug flag boolean
|
8
12
|
- Added additional debug logging for troubleshooting
|
data/bin/outlyer-metrics.rb
CHANGED
@@ -81,7 +81,7 @@ class OutlyerMetrics < Sensu::Handler
|
|
81
81
|
|
82
82
|
# Parse output for metric data
|
83
83
|
metrics = if config[:output_format] == 'nagios' then
|
84
|
-
parse_nagios_output(output
|
84
|
+
parse_nagios_output(output)
|
85
85
|
else
|
86
86
|
parse_graphite_output(output)
|
87
87
|
end
|
@@ -94,9 +94,8 @@ class OutlyerMetrics < Sensu::Handler
|
|
94
94
|
# <message> | <metric path 1>=<metric value 1>, <metric path 2>=<metric value 2>...
|
95
95
|
#
|
96
96
|
# @param output [String] The full check output
|
97
|
-
# @param timestamp[Integer] The epoch timestamp in milliseconds the check was executed
|
98
97
|
#
|
99
|
-
def parse_nagios_output(output
|
98
|
+
def parse_nagios_output(output)
|
100
99
|
data = []
|
101
100
|
parts = output.strip.split('|')
|
102
101
|
|
@@ -111,7 +110,7 @@ class OutlyerMetrics < Sensu::Handler
|
|
111
110
|
name = metric_parts[0]
|
112
111
|
value = metric_parts[1].split(";")[0].to_f
|
113
112
|
labels = {service: "sensu.#{sanitize_value(@check_name)}"}
|
114
|
-
data.push(create_datapoint(name, value,
|
113
|
+
data.push(create_datapoint(name, value, @event['check']['executed'].to_i * 1000, labels))
|
115
114
|
rescue => error
|
116
115
|
# Raised when any metrics could not be parsed
|
117
116
|
puts "The Nagios metric '#{metric}' could not be parsed: #{error.message}"
|
@@ -189,7 +188,7 @@ class OutlyerMetrics < Sensu::Handler
|
|
189
188
|
else
|
190
189
|
# If no template found, ignore metric and put warning in handler
|
191
190
|
# this avoids un-configured checks sending bad data to Outlyer
|
192
|
-
puts "No scheme was found that matches the metric '#{m[0]}.
|
191
|
+
puts "No scheme was found that matches the metric '#{m[0]}'."
|
193
192
|
puts "Please configure a scheme for the check '#{@check_name}' "\
|
194
193
|
"on the Sensu client '#{@host}'."
|
195
194
|
data.push(create_status_metric(3))
|
@@ -225,7 +224,11 @@ class OutlyerMetrics < Sensu::Handler
|
|
225
224
|
# @param timestamp [Integer] (Optional) timestamp of when host ran the check
|
226
225
|
#
|
227
226
|
def create_status_metric(check_status, host=@host, timestamp=@event['check']['executed'].to_i * 1000)
|
228
|
-
|
227
|
+
labels = {
|
228
|
+
service: sanitize_value(@check_name),
|
229
|
+
source: 'sensu'
|
230
|
+
}
|
231
|
+
return create_datapoint('service.status', check_status, timestamp, labels, host)
|
229
232
|
end
|
230
233
|
|
231
234
|
# Ensures all label values conform to Outlyer's data format requirements:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-outlyer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dataloop Software, INC. Trading as Outlyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.5.2
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Sensu plugins for Outlyer
|