sensu-plugins-redis 1.2.0 → 1.2.1

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: 32aaab200fa89a0df1f2e96d0f25049835aec207
4
- data.tar.gz: 1fd27f8c0897e82bf96d9d41d63ce8804a542995
3
+ metadata.gz: 447d31fe1bb0f6fcc5067a984a3a8ad038e261a6
4
+ data.tar.gz: 5e0d8891c54a4c6b8b4fd8634ebace1f39c4e6a8
5
5
  SHA512:
6
- metadata.gz: 28eebc5ad7bccc2cf71ad5f8bd75fc510f4a75c961a51247b24652e60ee7d07f22a8cd266db4757c8f7f0db324145084d36fd423a2534f927b30e9788c9195da
7
- data.tar.gz: dbbe5fc58e0c466c296d5e6be4f0c9fdc20497087a92971c75efbadd9dabadbb1f55605ac6fd6854682d70df87e59a66c18f34e53cfe87d0aad541d442fb308b
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.0...HEAD
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 = ['gcc_version', 'master_host', 'master_link_status',
18
- 'master_port', 'mem_allocator', 'multiplexing_api', 'process_id',
19
- 'redis_git_dirty', 'redis_git_sha1', 'redis_version', '^role',
20
- 'run_id', '^slave', 'used_memory_human', 'used_memory_peak_human',
21
- 'redis_mode', 'os', 'arch_bits', 'tcp_port',
22
- 'rdb_last_bgsave_status', 'aof_last_bgrewrite_status', 'config_file',
23
- 'redis_build_id'].freeze
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 SKIP_KEYS_REGEX.map { |re| k.match(/#{re}/) }.compact.empty?
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/
@@ -2,7 +2,7 @@ module SensuPluginsRedis
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.0
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-10 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin