sensu-plugins-redis 2.3.2 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -0
- data/bin/check-redis-connections-available.rb +64 -0
- data/lib/sensu-plugins-redis/version.rb +2 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ee163d20baee0f248d8085a48d8511f2dc4e2799458167f50c81d796183e1c
|
4
|
+
data.tar.gz: 7238e21603f96a50a0ef9b7f22090cf4b9a2b0f7783fd2a493ac2f8756dcab53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b901997098d32faac012e28ff3cac03e3d124c857c54cd063020c5b41f7d54cd8ec6b02d03990002e3a2cbca07271a1f1b924aa395774ff78499e1e018c39b84
|
7
|
+
data.tar.gz: 507e5d1e1c6e3947faba2d7be759778b7b1281e37ab8787957fad2d4ad3ba6cbaf900ffcbfcc7979bf9e0c56a7fe08586e34b0e2fd7b739a5cb1ad744846d6ac
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.4.0] - 2018-03-14
|
10
|
+
### Added
|
11
|
+
- check-redis-connections-available.rb: checks the number of connections available (@nishiki)
|
12
|
+
|
9
13
|
## [2.3.2] - 2017-12-21
|
10
14
|
### Fixed
|
11
15
|
- locked `development_dependency` of `mixlib-shellout` on to fix ruby 2.1 support (@majormoses)
|
@@ -131,7 +135,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
131
135
|
### Added
|
132
136
|
- initial release
|
133
137
|
|
134
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.
|
138
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.4.0...HEAD
|
139
|
+
[2.4.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.3.2...2.4.0
|
135
140
|
[2.3.2]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.3.1...2.3.2
|
136
141
|
[2.3.1]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.3.0...2.3.1
|
137
142
|
[2.3.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/2.2.2...2.3.0
|
data/README.md
CHANGED
@@ -0,0 +1,64 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# check-redis-connection.rb
|
4
|
+
#
|
5
|
+
# DESCRIPTION:
|
6
|
+
# This plugin checks the number of connections available on redis
|
7
|
+
#
|
8
|
+
# OUTPUT:
|
9
|
+
# plain text
|
10
|
+
#
|
11
|
+
# PLATFORMS:
|
12
|
+
# Linux
|
13
|
+
#
|
14
|
+
# DEPENDENCIES:
|
15
|
+
# gem: sensu-plugin
|
16
|
+
#
|
17
|
+
# USAGE:
|
18
|
+
# check-redis-connections-available.rb -c COUNT -w COUNT -h HOST
|
19
|
+
#
|
20
|
+
# LICENSE:
|
21
|
+
# Copyright Adrien Waksberg <adrien.waksberg@doctolib.fr>
|
22
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
23
|
+
# for details.
|
24
|
+
#
|
25
|
+
|
26
|
+
require 'sensu-plugin/check/cli'
|
27
|
+
require 'redis'
|
28
|
+
require_relative '../lib/redis_client_options'
|
29
|
+
|
30
|
+
class RedisConnectionsAvailable < Sensu::Plugin::Check::CLI
|
31
|
+
include RedisClientOptions
|
32
|
+
|
33
|
+
option :critical,
|
34
|
+
short: '-c COUNT',
|
35
|
+
long: '--critical COUNT',
|
36
|
+
description: 'COUNT critical threshold for number of connections available',
|
37
|
+
proc: proc(&:to_i),
|
38
|
+
required: true
|
39
|
+
|
40
|
+
option :warning,
|
41
|
+
short: '-w COUNT',
|
42
|
+
long: '--warning COUNT',
|
43
|
+
description: 'COUNT warning threshold for number of connections available',
|
44
|
+
proc: proc(&:to_i),
|
45
|
+
required: true
|
46
|
+
|
47
|
+
def run
|
48
|
+
redis = Redis.new(default_redis_options)
|
49
|
+
maxclients = redis.config('get', 'maxclients').last.to_i
|
50
|
+
clients = redis.info.fetch('connected_clients').to_i
|
51
|
+
conn_available = maxclients - clients
|
52
|
+
|
53
|
+
if conn_available <= config[:critical]
|
54
|
+
critical "Only #{conn_available} connections left available (#{clients}/#{maxclients})"
|
55
|
+
elsif conn_available <= config[:warning]
|
56
|
+
warning "Only #{conn_available} connections left available (#{clients}/#{maxclients})"
|
57
|
+
else
|
58
|
+
ok "There are #{conn_available} connections available (#{clients}/#{maxclients})"
|
59
|
+
end
|
60
|
+
|
61
|
+
rescue
|
62
|
+
send(config[:conn_failure_status], "Could not connect to Redis server on #{redis_endpoint}")
|
63
|
+
end
|
64
|
+
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: 2.
|
4
|
+
version: 2.4.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:
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -254,6 +254,7 @@ executables:
|
|
254
254
|
- metrics-redis-llen.rb
|
255
255
|
- check-redis-info.rb
|
256
256
|
- check-redis-list-length.rb
|
257
|
+
- check-redis-connections-available.rb
|
257
258
|
- check-redis-memory-percentage.rb
|
258
259
|
- check-redis-slave-status.rb
|
259
260
|
- check-redis-keys.rb
|
@@ -263,6 +264,7 @@ files:
|
|
263
264
|
- CHANGELOG.md
|
264
265
|
- LICENSE
|
265
266
|
- README.md
|
267
|
+
- bin/check-redis-connections-available.rb
|
266
268
|
- bin/check-redis-info.rb
|
267
269
|
- bin/check-redis-keys.rb
|
268
270
|
- bin/check-redis-list-length.rb
|
@@ -301,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
303
|
version: '0'
|
302
304
|
requirements: []
|
303
305
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.7.
|
306
|
+
rubygems_version: 2.7.6
|
305
307
|
signing_key:
|
306
308
|
specification_version: 4
|
307
309
|
summary: Sensu plugins for working with redis
|