sensu-plugins-redis 1.2.0 → 1.2.1
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 +8 -1
- data/bin/metrics-redis-graphite.rb +44 -8
- data/lib/sensu-plugins-redis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 447d31fe1bb0f6fcc5067a984a3a8ad038e261a6
|
4
|
+
data.tar.gz: 5e0d8891c54a4c6b8b4fd8634ebace1f39c4e6a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab1ce02085d7dbba326a7771163d19df4070f33de837c76bf9c117d8a09d99e873636e3e0e45eab892b2af24dbb157935b69442759fd7988a04040aae2a21330
|
7
|
+
data.tar.gz: 158090d4ee7f37c0ac5652e9294170a5ffd6326fa23589069799a53c0d389809de74ebbd7b6172defba16b519715d71ac56d106ca69dc74bd520fa4c23526a59
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ 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
|
+
## [1.2.1] - 2017-05-14
|
8
|
+
## Fixed
|
9
|
+
- Updated list of SKIP_KEYS_REGEX in metrics-redis-graphite.rb per #22 and added an option to override the list of keys to allow users to deal with changes without the need of a release (@majormoses)
|
10
|
+
|
11
|
+
## Added
|
12
|
+
- Added option to override SKIP_KEYS_REGEX via option. (@majormoses)
|
7
13
|
## [1.2.0] - 2017-05-09
|
8
14
|
### Changed
|
9
15
|
- check-redis-memory-percentage: Handle case where maxmemory is 0 (@stevenviola)
|
@@ -56,7 +62,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
56
62
|
### Added
|
57
63
|
- initial release
|
58
64
|
|
59
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.
|
65
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.1...HEAD
|
66
|
+
[1.2.1]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.0...1.2.1
|
60
67
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.1.0...1.2.0
|
61
68
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.0.0...1.1.0
|
62
69
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/0.1.0...1.0.0
|
@@ -14,13 +14,38 @@ require 'redis'
|
|
14
14
|
|
15
15
|
class Redis2Graphite < Sensu::Plugin::Metric::CLI::Graphite
|
16
16
|
# redis.c - sds genRedisInfoString(char *section)
|
17
|
-
SKIP_KEYS_REGEX = [
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
SKIP_KEYS_REGEX = [
|
18
|
+
'^role',
|
19
|
+
'^slave',
|
20
|
+
'aof_last_bgrewrite_status',
|
21
|
+
'aof_last_write_status',
|
22
|
+
'arch_bits',
|
23
|
+
'config_file',
|
24
|
+
'executable',
|
25
|
+
'gcc_version',
|
26
|
+
'master_host',
|
27
|
+
'master_link_status',
|
28
|
+
'master_port',
|
29
|
+
'mem_allocator',
|
30
|
+
'multiplexing_api',
|
31
|
+
'maxmemory_human',
|
32
|
+
'maxmemory_policy',
|
33
|
+
'os',
|
34
|
+
'process_id',
|
35
|
+
'rdb_last_bgsave_status',
|
36
|
+
'redis_build_id',
|
37
|
+
'redis_git_dirty',
|
38
|
+
'redis_git_sha1',
|
39
|
+
'redis_mode',
|
40
|
+
'redis_version',
|
41
|
+
'run_id',
|
42
|
+
'tcp_port',
|
43
|
+
'total_system_memory_human',
|
44
|
+
'used_memory_human',
|
45
|
+
'used_memory_lua_human',
|
46
|
+
'used_memory_peak_human',
|
47
|
+
'used_memory_rss_human'
|
48
|
+
].freeze
|
24
49
|
|
25
50
|
option :host,
|
26
51
|
short: '-h HOST',
|
@@ -60,6 +85,12 @@ class Redis2Graphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
60
85
|
proc: proc(&:to_i),
|
61
86
|
default: Redis::Client::DEFAULTS[:reconnect_attempts]
|
62
87
|
|
88
|
+
option :skip_keys_regex,
|
89
|
+
description: 'a comma seperated list of keys to be skipped',
|
90
|
+
short: '-k',
|
91
|
+
long: '--skipkeys',
|
92
|
+
default: nil
|
93
|
+
|
63
94
|
def run
|
64
95
|
options = {
|
65
96
|
host: config[:host],
|
@@ -69,9 +100,14 @@ class Redis2Graphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
69
100
|
}
|
70
101
|
options[:password] = config[:password] if config[:password]
|
71
102
|
redis = Redis.new(options)
|
103
|
+
skip_keys = if !config[:skip_keys_regex].nil?
|
104
|
+
config[:skip_keys_regex].split(',')
|
105
|
+
else
|
106
|
+
SKIP_KEYS_REGEX
|
107
|
+
end
|
72
108
|
|
73
109
|
redis.info.each do |k, v|
|
74
|
-
next unless
|
110
|
+
next unless skip_keys.map { |re| k.match(/#{re}/) }.compact.empty?
|
75
111
|
|
76
112
|
# "db0"=>"keys=123,expires=12"
|
77
113
|
if k =~ /^db/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|