bin/check-redis-info.rb in sensu-plugins-redis-0.0.4 vs bin/check-redis-info.rb in sensu-plugins-redis-0.1.0
- old
+ new
@@ -57,13 +57,13 @@
def run
options = { host: config[:host], port: config[:port] }
options[:password] = config[:password] if config[:password]
redis = Redis.new(options)
- if redis.info.fetch("#{config[:redis_info_key]}") == "#{config[:redis_info_value]}"
+ if redis.info.fetch(config[:redis_info_key].to_s) == config[:redis_info_value].to_s
ok "Redis #{config[:redis_info_key]} is #{config[:redis_info_value]}"
else
- critical "Redis #{config[:redis_info_key]} is #{redis.info.fetch("#{config[:redis_info_key]}")}!"
+ critical "Redis #{config[:redis_info_key]} is #{redis.info.fetch(config[:redis_info_key].to_s)}!"
end
rescue
message "Could not connect to Redis server on #{config[:host]}:#{config[:port]}"
exit 1