bin/check-beanstalkd.rb in sensu-plugins-beanstalk-1.2.0 vs bin/check-beanstalkd.rb in sensu-plugins-beanstalk-2.0.0
- old
+ new
@@ -57,11 +57,11 @@
option :alert_on_missing,
description: 'alert type when tube is missing',
short: '-a TYPE',
long: '--alert-on-missing TYPE',
proc: proc { |value| value.to_sym },
- in: [:critical, :warning, :ignore],
+ in: %i[critical warning ignore],
default: :ignore
option :ready,
description: 'ready tasks WARNING/CRITICAL thresholds',
short: '-r W,C',
@@ -84,11 +84,11 @@
default: [30, 60]
def acquire_beanstalkd_connection
begin
conn = Beaneater::Pool.new(["#{config[:server]}:#{config[:port]}"])
- rescue
+ rescue StandardError
warning 'could not connect to beanstalkd'
end
conn
end
@@ -107,10 +107,10 @@
end
ok
end
- JOB_STATES = [:ready, :urgent, :buried].freeze
+ JOB_STATES = %i[ready urgent buried].freeze
def check_queues(stats)
msg = []
crits = {}
warns = {}