bin/check-beanstalkd.rb in sensu-plugins-beanstalk-0.0.3 vs bin/check-beanstalkd.rb in sensu-plugins-beanstalk-0.0.4
- old
+ new
@@ -82,29 +82,29 @@
warning 'could not connect to beanstalkd'
end
conn
end
- def run # rubocop:disable all
- stats = acquire_beanstalkd_connection.tubes["#{config[:tube]}"].stats
+ def run
+ stats = acquire_beanstalkd_connection.tubes[config[:tube].to_s].stats
message 'All queues are healthy'
warns, crits, msg = check_queues(stats)
msg.join("\n")
- if crits.size > 0
+ if crits.size > 0 # rubocop:disable Style/ZeroLengthPredicate
message msg
critical
end
- if warns.size > 0
+ if warns.size > 0 # rubocop:disable Style/ZeroLengthPredicate
message msg
warning
end
ok
end
- def check_queues(stats) # rubocop:disable all
+ def check_queues(stats)
msg = []
crits = {}
warns = {}
[:ready, :urgent, :buried].each do |task|