sensu-plugins-redis 4.0.0 → 4.1.0

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
  SHA256:
3
- metadata.gz: def24985b8017d5b279b106ce0e53ee4ac595014339d3e4df6ecf42f856ad4da
4
- data.tar.gz: bb6d4125d9711fe4da922d2f6a983c84ea3bdbf137f19799488d71c5fc6e8f9f
3
+ metadata.gz: 86f53517b67cb3aaa5fcc953809ef66429c79c43ba2aad9bf5074226508c0c01
4
+ data.tar.gz: dfd7ea6dff5c4c6169122ef30a15c387880198f635ba89f2c48f8d6bcce73375
5
5
  SHA512:
6
- metadata.gz: f02b2e06c9e35bf70ee58d0a0fe91ca094880542eac1be4fc0ba4743f2c5c2b6531ae84ac3116ce485fbcb22441209df2d2c6df1ff7eaab534267ce36b1f395a
7
- data.tar.gz: f4e47875ab08bdafb099967217c5eb6fa71dcf9f2b2a4755652f8f569eaeb41801d5923f7ef94f530a4cfd7998a663c1f78e261bc3c60516d878636028e7ad9d
6
+ metadata.gz: d84e15e8bd2c0853ed43731083c7f9e508b6df19e58130738ec62bc58bc7e7f2f8465dbcfaa5772f9226de286534f578a474eaa4bc8f1dfdfde6bfeaf7c9d99f
7
+ data.tar.gz: e9d18fda5c1213871de6257bd82d779ac6dc77581ba5ad0bb31d2e4a47d4ec1c4856c4cedcb1b14777c705d3f675b218587e778a63fa75cb49feba3b42ae04f0
data/CHANGELOG.md CHANGED
@@ -1,11 +1,15 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Our CHANGELOG Guidelines ](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md).
4
+ This CHANGELOG follows the format listed at [Our CHANGELOG Guidelines](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md).
5
5
  Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [4.1.0] - 2019-05-06
10
+ ### Added
11
+ - `metrics-redis-keys.rb` metric about the number of keys matching a given pattern (@ydkn)
12
+
9
13
  ## [4.0.0] - 2019-04-24
10
14
  ### Breaking Changes
11
15
  - dropping ruby support for `< 2.3` as they are EOL (@majormoses)
@@ -168,7 +172,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
168
172
  ### Added
169
173
  - initial release
170
174
 
171
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/4.0.0...HEAD
175
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/4.1.0...HEAD
176
+ [4.1.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/4.0.0...4.0.0
172
177
  [4.0.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/3.1.1...4.0.0
173
178
  [3.1.1]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/3.1.0...3.1.1
174
179
  [3.1.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/3.0.1...3.1.0
data/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  * bin/check-redis-slave-status.rb
19
19
  * bin/check-redis-connections-available.rb
20
20
  * bin/metrics-redis-graphite.rb
21
+ * bin/metrics-redis-keys.rb
21
22
  * bin/metrics-redis-llen.rb
22
23
 
23
24
  ## Usage
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
4
+ #
5
+ # Get the number of keys and push it to graphite
6
+ #
7
+ #
8
+ #
9
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
10
+ # for details.
11
+
12
+ require 'sensu-plugin/metric/cli'
13
+ require 'redis'
14
+ require_relative '../lib/redis_client_options'
15
+
16
+ class RedisKeysNumberMetric < Sensu::Plugin::Metric::CLI::Graphite
17
+ include RedisClientOptions
18
+
19
+ option :scheme,
20
+ description: 'Metric naming scheme, text to prepend to metric',
21
+ short: '-S SCHEME',
22
+ long: '--scheme SCHEME',
23
+ default: "#{Socket.gethostname}.redis"
24
+
25
+ option :metricname,
26
+ short: '-M METRICNAME',
27
+ long: '--metric-name METRICNAME',
28
+ description: 'Name of the metric key. Defaults to "keys"',
29
+ required: false,
30
+ default: 'keys'
31
+
32
+ option :pattern,
33
+ long: '--pattern PATTERN',
34
+ description: 'Argument passed into keys command. Defaults to *',
35
+ required: false,
36
+ default: '*'
37
+
38
+ def run
39
+ redis = Redis.new(default_redis_options)
40
+
41
+ output "#{config[:scheme]}.#{config[:metricname]}", redis.keys(config[:pattern]).size
42
+
43
+ ok
44
+ rescue StandardError
45
+ send(config[:conn_failure_status], "Could not connect to Redis server on #{redis_endpoint}")
46
+ end
47
+ end
@@ -3,7 +3,7 @@
3
3
  module SensuPluginsRedis
4
4
  module Version
5
5
  MAJOR = 4
6
- MINOR = 0
6
+ MINOR = 1
7
7
  PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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: 4.0.0
4
+ version: 4.1.0
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: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -236,6 +236,7 @@ email: "<sensu-users@googlegroups.com>"
236
236
  executables:
237
237
  - check-redis-ping.rb
238
238
  - check-redis-memory.rb
239
+ - metrics-redis-keys.rb
239
240
  - metrics-redis-graphite.rb
240
241
  - metrics-redis-llen.rb
241
242
  - check-redis-info.rb
@@ -259,6 +260,7 @@ files:
259
260
  - bin/check-redis-ping.rb
260
261
  - bin/check-redis-slave-status.rb
261
262
  - bin/metrics-redis-graphite.rb
263
+ - bin/metrics-redis-keys.rb
262
264
  - bin/metrics-redis-llen.rb
263
265
  - lib/redis_client_options.rb
264
266
  - lib/sensu-plugins-redis.rb