sensu-plugins-redis 1.2.2 → 1.3.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: 1dabba3da868ee6fd5dfed084268102cf36a1446
4
- data.tar.gz: f6c7b92239a2ad94453c9b8757cc3f9b6fd1e144
3
+ metadata.gz: 6d5a2e7ad15cec51e30e8b1d89902aec3cca0c3e
4
+ data.tar.gz: 4e389ecc0f27b5f52bf5e6a2a4d2c844415df5b8
5
5
  SHA512:
6
- metadata.gz: 4b4bc213e3363acc1dfe6d0f2414e9bfa93607ea7271198133ae7e7b88531817fed243e8fa415db6740fc3c88116f96bf1239c6ffb94627648410be564f8eea2
7
- data.tar.gz: 752ba0c5aecdebe4248ea41309e474f1df904a715f1f02908bdca82fbffdd8643efb44966e03598d53e0aa40c37194f31f9252366950ac0d856ceccdf19cedd5
6
+ metadata.gz: 88aa138e23e8ffb72089d7fe39e3a0cf5625a064d8178b891e52904688190ae01d528ac6011eb90074a0669249c5d60be130393e6ac5ec3cdf99a8827afe4a23
7
+ data.tar.gz: e5f5d5099413025154c92553ccef950d7ab6cdca0212599227cbe699206e49cf1f2000c62ee2489fe18bad0779af541a7dbebdd95690e1966ea710df011dd7ab
@@ -1,18 +1,23 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+
8
+ ## [1.3.0] - 2017-05-31
9
+ ### Added
10
+ - Added option to connect to Redis via Unix sockets. (@mbyczkowski)
11
+
7
12
  ## [1.2.2] - 2017-05-31
8
- ## Fixed
13
+ ### Fixed
9
14
  - metrics-redis-graphite: fix skipkeys option not accepting any argument (@boutetnico)
10
15
 
11
16
  ## [1.2.1] - 2017-05-14
12
- ## Fixed
17
+ ### Fixed
13
18
  - 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)
14
19
 
15
- ## Added
20
+ ### Added
16
21
  - Added option to override SKIP_KEYS_REGEX via option. (@majormoses)
17
22
  ## [1.2.0] - 2017-05-09
18
23
  ### Changed
@@ -66,7 +71,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
66
71
  ### Added
67
72
  - initial release
68
73
 
69
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.2...HEAD
74
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.3.0...HEAD
75
+ [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.2...1.3.0
70
76
  [1.2.2]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.1...1.2.2
71
77
  [1.2.1]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.2.0...1.2.1
72
78
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-redis/compare/1.1.0...1.2.0
@@ -20,6 +20,12 @@ require 'sensu-plugin/check/cli'
20
20
  require 'redis'
21
21
 
22
22
  class RedisSlaveCheck < Sensu::Plugin::Check::CLI
23
+ option :socket,
24
+ short: '-s SOCKET',
25
+ long: '--socket SOCKET',
26
+ description: 'Redis socket to connect to (overrides Host and Port)',
27
+ required: false
28
+
23
29
  option :host,
24
30
  short: '-h HOST',
25
31
  long: '--host HOST',
@@ -55,7 +61,12 @@ class RedisSlaveCheck < Sensu::Plugin::Check::CLI
55
61
  default: 'master'
56
62
 
57
63
  def run
58
- options = { host: config[:host], port: config[:port] }
64
+ options = if config[:socket]
65
+ { path: socket }
66
+ else
67
+ { host: config[:host], port: config[:port] }
68
+ end
69
+
59
70
  options[:password] = config[:password] if config[:password]
60
71
  redis = Redis.new(options)
61
72
 
@@ -64,7 +75,6 @@ class RedisSlaveCheck < Sensu::Plugin::Check::CLI
64
75
  else
65
76
  critical "Redis #{config[:redis_info_key]} is #{redis.info.fetch(config[:redis_info_key].to_s)}!"
66
77
  end
67
-
68
78
  rescue
69
79
  message "Could not connect to Redis server on #{config[:host]}:#{config[:port]}"
70
80
  exit 1
@@ -14,6 +14,12 @@ require 'sensu-plugin/check/cli'
14
14
  require 'redis'
15
15
 
16
16
  class RedisKeysCheck < Sensu::Plugin::Check::CLI
17
+ option :socket,
18
+ short: '-s SOCKET',
19
+ long: '--socket SOCKET',
20
+ description: 'Redis socket to connect to (overrides Host and Port)',
21
+ required: false
22
+
17
23
  option :host,
18
24
  short: '-h HOST',
19
25
  long: '--host HOST',
@@ -63,7 +69,13 @@ class RedisKeysCheck < Sensu::Plugin::Check::CLI
63
69
  default: '*'
64
70
 
65
71
  def run
66
- options = { host: config[:host], port: config[:port], db: config[:database] }
72
+ options = if config[:socket]
73
+ { path: socket }
74
+ else
75
+ { host: config[:host], port: config[:port] }
76
+ end
77
+
78
+ options[:db] = config[:database]
67
79
  options[:password] = config[:password] if config[:password]
68
80
  redis = Redis.new(options)
69
81
 
@@ -15,6 +15,12 @@ require 'sensu-plugin/check/cli'
15
15
  require 'redis'
16
16
 
17
17
  class RedisListLengthCheck < Sensu::Plugin::Check::CLI
18
+ option :socket,
19
+ short: '-s SOCKET',
20
+ long: '--socket SOCKET',
21
+ description: 'Redis socket to connect to (overrides Host and Port)',
22
+ required: false
23
+
18
24
  option :host,
19
25
  short: '-h HOST',
20
26
  long: '--host HOST',
@@ -64,7 +70,13 @@ class RedisListLengthCheck < Sensu::Plugin::Check::CLI
64
70
  required: true
65
71
 
66
72
  def run
67
- options = { host: config[:host], port: config[:port], db: config[:database] }
73
+ options = if config[:socket]
74
+ { path: socket }
75
+ else
76
+ { host: config[:host], port: config[:port] }
77
+ end
78
+
79
+ options[:db] = config[:database]
68
80
  options[:password] = config[:password] if config[:password]
69
81
  redis = Redis.new(options)
70
82
 
@@ -30,6 +30,12 @@
30
30
  require 'sensu-plugin/check/cli'
31
31
  require 'redis'
32
32
  class RedisChecks < Sensu::Plugin::Check::CLI
33
+ option :socket,
34
+ short: '-s SOCKET',
35
+ long: '--socket SOCKET',
36
+ description: 'Redis socket to connect to (overrides Host and Port)',
37
+ required: false
38
+
33
39
  option :host,
34
40
  short: '-h HOST',
35
41
  long: '--host HOST',
@@ -75,7 +81,12 @@ class RedisChecks < Sensu::Plugin::Check::CLI
75
81
  end
76
82
 
77
83
  def run
78
- options = { host: config[:host], port: config[:port] }
84
+ options = if config[:socket]
85
+ { path: socket }
86
+ else
87
+ { host: config[:host], port: config[:port] }
88
+ end
89
+
79
90
  options[:password] = config[:password] if config[:password]
80
91
  redis = Redis.new(options)
81
92
 
@@ -12,6 +12,12 @@ require 'sensu-plugin/check/cli'
12
12
  require 'redis'
13
13
 
14
14
  class RedisChecks < Sensu::Plugin::Check::CLI
15
+ option :socket,
16
+ short: '-s SOCKET',
17
+ long: '--socket SOCKET',
18
+ description: 'Redis socket to connect to (overrides Host and Port)',
19
+ required: false
20
+
15
21
  option :host,
16
22
  short: '-h HOST',
17
23
  long: '--host HOST',
@@ -53,7 +59,12 @@ class RedisChecks < Sensu::Plugin::Check::CLI
53
59
  default: false
54
60
 
55
61
  def run
56
- options = { host: config[:host], port: config[:port] }
62
+ options = if config[:socket]
63
+ { path: socket }
64
+ else
65
+ { host: config[:host], port: config[:port] }
66
+ end
67
+
57
68
  options[:password] = config[:password] if config[:password]
58
69
  redis = Redis.new(options)
59
70
 
@@ -31,6 +31,12 @@ require 'sensu-plugin/check/cli'
31
31
  require 'redis'
32
32
 
33
33
  class RedisPing < Sensu::Plugin::Check::CLI
34
+ option :socket,
35
+ short: '-s SOCKET',
36
+ long: '--socket SOCKET',
37
+ description: 'Redis socket to connect to (overrides Host and Port)',
38
+ required: false
39
+
34
40
  option :host,
35
41
  short: '-h HOST',
36
42
  long: '--host HOST',
@@ -52,11 +58,18 @@ class RedisPing < Sensu::Plugin::Check::CLI
52
58
  description: 'Redis Password to connect with'
53
59
 
54
60
  def redis_options
55
- {
56
- host: config[:host],
57
- port: config[:port],
58
- password: config[:password]
59
- }
61
+ if config[:socket]
62
+ {
63
+ path: config[:socket],
64
+ password: config[:password]
65
+ }
66
+ else
67
+ {
68
+ host: config[:host],
69
+ port: config[:port],
70
+ password: config[:password]
71
+ }
72
+ end
60
73
  end
61
74
 
62
75
  def run
@@ -6,6 +6,12 @@ require 'sensu-plugin/check/cli'
6
6
  require 'redis'
7
7
 
8
8
  class RedisSlaveCheck < Sensu::Plugin::Check::CLI
9
+ option :socket,
10
+ short: '-s SOCKET',
11
+ long: '--socket SOCKET',
12
+ description: 'Redis socket to connect to (overrides Host and Port)',
13
+ required: false
14
+
9
15
  option :host,
10
16
  short: '-h HOST',
11
17
  long: '--host HOST',
@@ -27,7 +33,12 @@ class RedisSlaveCheck < Sensu::Plugin::Check::CLI
27
33
  description: 'Redis Password to connect with'
28
34
 
29
35
  def run
30
- options = { host: config[:host], port: config[:port] }
36
+ options = if config[:socket]
37
+ { path: socket }
38
+ else
39
+ { host: config[:host], port: config[:port] }
40
+ end
41
+
31
42
  options[:password] = config[:password] if config[:password]
32
43
  redis = Redis.new(options)
33
44
 
@@ -47,6 +47,12 @@ class Redis2Graphite < Sensu::Plugin::Metric::CLI::Graphite
47
47
  'used_memory_rss_human'
48
48
  ].freeze
49
49
 
50
+ option :socket,
51
+ short: '-s SOCKET',
52
+ long: '--socket SOCKET',
53
+ description: 'Redis socket to connect to (overrides Host and Port)',
54
+ required: false
55
+
50
56
  option :host,
51
57
  short: '-h HOST',
52
58
  long: '--host HOST',
@@ -93,11 +99,17 @@ class Redis2Graphite < Sensu::Plugin::Metric::CLI::Graphite
93
99
 
94
100
  def run
95
101
  options = {
96
- host: config[:host],
97
- port: config[:port],
98
102
  timeout: config[:timeout],
99
103
  reconnect_attempts: config[:reconnect_attempts]
100
104
  }
105
+
106
+ if config[:socket]
107
+ options[:path] = config[:socket]
108
+ else
109
+ options[:host] = config[:host]
110
+ options[:port] = config[:port]
111
+ end
112
+
101
113
  options[:password] = config[:password] if config[:password]
102
114
  redis = Redis.new(options)
103
115
  skip_keys = if !config[:skip_keys_regex].nil?
@@ -11,6 +11,12 @@ require 'sensu-plugin/metric/cli'
11
11
  require 'redis'
12
12
 
13
13
  class RedisListLengthMetric < Sensu::Plugin::Metric::CLI::Graphite
14
+ option :socket,
15
+ short: '-s SOCKET',
16
+ long: '--socket SOCKET',
17
+ description: 'Redis socket to connect to (overrides Host and Port)',
18
+ required: false
19
+
14
20
  option :host,
15
21
  short: '-h HOST',
16
22
  long: '--host HOST',
@@ -42,7 +48,12 @@ class RedisListLengthMetric < Sensu::Plugin::Metric::CLI::Graphite
42
48
  required: true
43
49
 
44
50
  def run
45
- options = { host: config[:host], port: config[:port] }
51
+ options = if config[:socket]
52
+ { path: socket }
53
+ else
54
+ { host: config[:host], port: config[:port] }
55
+ end
56
+
46
57
  options[:password] = config[:password] if config[:password]
47
58
  redis = Redis.new(options)
48
59
 
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsRedis
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 2
5
- PATCH = 2
4
+ MINOR = 3
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.2.2
4
+ version: 1.3.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-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin