sensu-plugins-twemproxy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/bin/metrics-twemproxy.rb +13 -2
- data/lib/sensu-plugins-twemproxy/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: 755736c573b0f2ca0b07b8d7e6508025db039fc7
|
4
|
+
data.tar.gz: 07f8b0424a3061d9be7f2542ccd9e692910af764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b653d4684e1970498d4b85823db7b2ac5b79140235f5c4969b751fc02dc2d6697e86e35ce81c792ea99e857d5a2df61dea2d27692d042fbc9142d992dccc27
|
7
|
+
data.tar.gz: 2694fd8e5b2b4ffa0a764fe846c303b5ef01ed80c576fef86ddba93802a027ccb5664bb813af994c7c24d3e1313307c777dcb1c61959defa5b86cfe016a5b243
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
-
#Change Log
|
1
|
+
# Change Log
|
2
2
|
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
6
|
## [Unreleased]
|
7
|
+
## [1.0.1] 2017-07-10
|
8
|
+
### Fixed
|
9
|
+
- Update ignored JSON keys to prevent script crashing out (@Evesy)
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- Config option to provide alternative list of keys to ignore (@Evesy)
|
13
|
+
|
7
14
|
## [1.0.0] - 2017-07-09
|
8
15
|
### Added
|
9
16
|
- Testing on Ruby 2.3.0 & 2.4.1 (@Evesy)
|
@@ -27,6 +34,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
27
34
|
- initial release
|
28
35
|
|
29
36
|
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/1.0.0...HEAD
|
37
|
+
[1.0.1]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/1.0.0...1.0.1
|
30
38
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.3...1.0.0
|
31
39
|
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.2...0.0.3
|
32
40
|
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.1...0.0.2
|
data/bin/metrics-twemproxy.rb
CHANGED
@@ -36,7 +36,7 @@ require 'json'
|
|
36
36
|
# Twemproxy metrics
|
37
37
|
#
|
38
38
|
class Twemproxy2Graphite < Sensu::Plugin::Metric::CLI::Graphite
|
39
|
-
|
39
|
+
SKIP_KEYS = %w(service source version uptime timestamp total_connections curr_connections).freeze
|
40
40
|
|
41
41
|
option :host,
|
42
42
|
description: 'Twemproxy stats host to connect to',
|
@@ -68,11 +68,22 @@ class Twemproxy2Graphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
68
68
|
proc: proc(&:to_i),
|
69
69
|
default: 5
|
70
70
|
|
71
|
+
option :skip_keys,
|
72
|
+
description: 'Keys to skip when looping through metrics (Comma seperated)',
|
73
|
+
short: '-k KEYS',
|
74
|
+
long: '--skip-keys KEYS'
|
75
|
+
|
71
76
|
def run
|
77
|
+
skip_keys = if config[:skip_keys]
|
78
|
+
config[:skip_keys].split(',')
|
79
|
+
else
|
80
|
+
SKIP_KEYS
|
81
|
+
end
|
82
|
+
|
72
83
|
Timeout.timeout(config[:timeout]) do
|
73
84
|
sock = TCPSocket.new(config[:host], config[:port])
|
74
85
|
data = JSON.parse(sock.read)
|
75
|
-
pools = data.keys -
|
86
|
+
pools = data.keys - skip_keys
|
76
87
|
|
77
88
|
pools.each do |pool_key|
|
78
89
|
data[pool_key].each do |key, value|
|