sensu-plugins-redis 4.0.0 → 4.1.0
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 +7 -2
- data/README.md +1 -0
- data/bin/metrics-redis-keys.rb +47 -0
- data/lib/sensu-plugins-redis/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86f53517b67cb3aaa5fcc953809ef66429c79c43ba2aad9bf5074226508c0c01
|
4
|
+
data.tar.gz: dfd7ea6dff5c4c6169122ef30a15c387880198f635ba89f2c48f8d6bcce73375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
@@ -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
|
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.
|
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-
|
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
|