bin/check-redis-info.rb in sensu-plugins-redis-2.1.0 vs bin/check-redis-info.rb in sensu-plugins-redis-2.2.0
- old
+ new
@@ -64,14 +64,21 @@
long: '--conn-failure-status EXIT_STATUS',
description: 'Returns the following exit status for Redis connection failures',
default: 'unknown',
in: %w(unknown warning critical)
+ option :timeout,
+ short: '-t TIMEOUT',
+ long: '--timeout TIMEOUT',
+ description: 'Redis connection timeout',
+ required: false,
+ default: 5
+
def run
options = if config[:socket]
{ path: socket }
else
- { host: config[:host], port: config[:port] }
+ { host: config[:host], port: config[:port], timeout: config[:timeout] }
end
options[:password] = config[:password] if config[:password]
redis = Redis.new(options)