sensu-plugins-redis 1.3.1 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1de16379e596b5c7e6bdab0f503efd47317bf71a
4
- data.tar.gz: 4f961f3e7d7c4947a6b7c9029c2958d9dc51151a
3
+ metadata.gz: bd85ed962f2d4ad9b17984f5b347567b501323f8
4
+ data.tar.gz: fc2352c0eeea0effc4af1c8701206372e5655202
5
5
  SHA512:
6
- metadata.gz: e1a5ebcbf245893dd3e5eb880b2297e7130bd7e7379225242ce16bb33154f80c834143fc6eb7ea9fdf4af74a9002cf112631354077920ef824e9581809ea2696
7
- data.tar.gz: f9e86330e8a43615df701efee9dca27933fef37d8505b853efe6283b8a05329c84af3eb566bb6c10bb06745c2583eb7a7498807b9065d43daeae5fefcfbc3ff1
6
+ metadata.gz: d69a0960c67f8bb9e168d1c737d53bb3be169fdd83e641a8b4cf7a4b36d2f22a4286c9d47073da2090edf2640deee823d4856b3cd0863e1684b4e60ff3c11441
7
+ data.tar.gz: 43226f41e13daa2b72f6d9c9e2c34740e707cd56530e41688d60afa21888bd953674b786d1234cebdd4f273ad28dff38b7ba9865b3a60af411087824ff0cdf54
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.4.0] - 2017-06-24
9
+ ### Added
10
+ - check-redis-list-length.rb support more datatypes to check (@nevins-b)
11
+
8
12
  ## [1.3.1] - 2017-05-31
9
13
  ### Fixed
10
14
  - metrics-redis-graphite: fix commandstats output (@boutetnico)
@@ -75,7 +79,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
75
79
  ### Added
76
80
  - initial release
77
81
 
78
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.3.1...HEAD
82
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.4.0...HEAD
83
+ [1.4.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.3.1...1.4.0
79
84
  [1.3.1]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.3.0...1.3.1
80
85
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.2...1.3.0
81
86
  [1.2.2]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.1...1.2.2
data/README.md CHANGED
@@ -15,7 +15,6 @@
15
15
  * bin/check-redis-memory-percentage.rb
16
16
  * bin/check-redis-ping.rb
17
17
  * bin/check-redis-slave-status.rb
18
- * bin/extension-redis-output.rb
19
18
  * bin/metrics-redis-graphite.rb
20
19
  * bin/metrics-redis-llen.rb
21
20
 
@@ -80,14 +80,21 @@ class RedisListLengthCheck < Sensu::Plugin::Check::CLI
80
80
  options[:password] = config[:password] if config[:password]
81
81
  redis = Redis.new(options)
82
82
 
83
- length = redis.llen(config[:key])
83
+ length = case redis.type(config[:key])
84
+ when 'hash'
85
+ redis.hlen(config[:key])
86
+ when 'set'
87
+ redis.scard(config[:key])
88
+ else
89
+ redis.llen(config[:key])
90
+ end
84
91
 
85
92
  if length >= config[:crit]
86
93
  critical "Redis list #{config[:key]} length is above the CRITICAL limit: #{length} length / #{config[:crit]} limit"
87
94
  elsif length >= config[:warn]
88
95
  warning "Redis list #{config[:key]} length is above the WARNING limit: #{length} length / #{config[:warn]} limit"
89
96
  else
90
- ok "Redis list #{config[:key]} length is below thresholds"
97
+ ok "Redis list #{config[:key]} length (#{length}) is below thresholds"
91
98
  end
92
99
  rescue
93
100
  unknown "Could not connect to Redis server on #{config[:host]}:#{config[:port]}"
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsRedis
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 3
5
- PATCH = 1
4
+ MINOR = 4
5
+ PATCH = 0
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.3.1
4
+ version: 1.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: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin