sensu-plugins-graphite 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +9 -0
- data/bin/check-graphite-data.rb +0 -1
- data/bin/check-graphite-hosts.rb +0 -1
- data/bin/check-graphite-stats.rb +20 -6
- data/bin/handler-graphite-event.rb +1 -1
- data/lib/sensu-plugins-graphite/graphite_proxy/options.rb +1 -1
- data/lib/sensu-plugins-graphite/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9b47b908225a034886cf53e05210d7364b74ad
|
4
|
+
data.tar.gz: 8519202e2e3a17afb71976483c3b828f67debd8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d62bfe5b3e8ef036e99441179c2791e85be02decfe1101424a6aec46cc7a0f26b80ab8808150e19a9d84686a0f170e56ff8df33b0babc909519a76a53e195d3e
|
7
|
+
data.tar.gz: 10875b3238b6744885485df857d6d137378e9a0adb5f96c0cc241af54dd22143215919d4a604e85889677754d0e19c45e4922bd8caa272753502ee7acfe7fbc6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
- nothing
|
8
|
+
|
9
|
+
## [0.0.7] - 2015-09-29
|
10
|
+
### Added
|
11
|
+
- add -r option (Reverse the warning/crit scale (if value is less than instead of greater than)) to check-graphite-stats.rb
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- The short command line option for 'Add an auth token to the HTTP request' is now -A, -a clashed with the proxy support
|
15
|
+
- Set socket's SSL mode only if using HTTPS
|
7
16
|
|
8
17
|
## [0.0.6] - 2015-08-27
|
9
18
|
### Added
|
data/bin/check-graphite-data.rb
CHANGED
data/bin/check-graphite-hosts.rb
CHANGED
data/bin/check-graphite-stats.rb
CHANGED
@@ -79,6 +79,13 @@ class CheckGraphiteStat < Sensu::Plugin::Check::CLI
|
|
79
79
|
boolean: true,
|
80
80
|
default: false
|
81
81
|
|
82
|
+
option :reverse_scale,
|
83
|
+
short: '-r',
|
84
|
+
long: '--reverse-scale',
|
85
|
+
description: 'Reverse the warning/crit scale (if value is less than instead of greater than)',
|
86
|
+
boolean: true,
|
87
|
+
default: false
|
88
|
+
|
82
89
|
def average(a)
|
83
90
|
total = 0
|
84
91
|
a.to_a.each { |i| total += i.to_f }
|
@@ -92,11 +99,18 @@ class CheckGraphiteStat < Sensu::Plugin::Check::CLI
|
|
92
99
|
# #YELLOW
|
93
100
|
unless datapoints.empty? # rubocop:disable UnlessElse
|
94
101
|
avg = average(datapoints)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
102
|
+
if config[:reverse_scale] == false
|
103
|
+
if !config[:crit].nil? && avg > config[:crit]
|
104
|
+
return [2, "#{metric['target']} is #{avg}"]
|
105
|
+
elsif !config[:warn].nil? && avg > config[:warn]
|
106
|
+
return [1, "#{metric['target']} is #{avg}"]
|
107
|
+
end
|
108
|
+
else
|
109
|
+
if !config[:crit].nil? && avg < config[:crit]
|
110
|
+
return [2, "#{metric['target']} is #{avg}"]
|
111
|
+
elsif !config[:warn].nil? && avg < config[:warn]
|
112
|
+
return [1, "#{metric['target']} is #{avg}"]
|
113
|
+
end
|
100
114
|
end
|
101
115
|
else
|
102
116
|
return [3, "#{metric['target']} has no datapoints"] unless config[:unknown_ignore]
|
@@ -107,7 +121,7 @@ class CheckGraphiteStat < Sensu::Plugin::Check::CLI
|
|
107
121
|
def run
|
108
122
|
body =
|
109
123
|
begin
|
110
|
-
uri = URI("http://#{config[:host]}/render?format=json&target=#{config[:target]}&from=#{config[:period]}")
|
124
|
+
uri = URI.parse(URI.encode("http://#{config[:host]}/render?format=json&target=#{config[:target]}&from=#{config[:period]}"))
|
111
125
|
res = Net::HTTP.get_response(uri)
|
112
126
|
res.body
|
113
127
|
rescue => e
|
@@ -26,7 +26,7 @@ class GraphiteEvent < Sensu::Handler
|
|
26
26
|
uri = URI.parse(uri)
|
27
27
|
req = Net::HTTP::Post.new(uri.path)
|
28
28
|
sock = Net::HTTP.new(uri.host, uri.port)
|
29
|
-
sock.use_ssl = true
|
29
|
+
sock.use_ssl = uri.scheme == 'https' ? true : false
|
30
30
|
req.body = body
|
31
31
|
|
32
32
|
req.basic_auth(uri.user, uri.password) if uri.user
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu Plugins and contributors
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
31
|
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: array_stats
|
metadata.gz.sig
CHANGED
Binary file
|