bin/check-dns.rb in sensu-plugins-dns-1.4.1 vs bin/check-dns.rb in sensu-plugins-dns-2.0.0
- old
+ new
@@ -131,11 +131,11 @@
count = 0
while count < config[:request_count]
begin
entry = resolv.query(config[:domain], config[:type], config[:class])
resolv.query_timeout = config[:timeout]
- rescue => e
+ rescue StandardError => e
entry = e
end
entries << entry
puts "Entry #{count}: #{entry}" if config[:debug]
count += 1
@@ -153,10 +153,10 @@
end
b.each do |answer|
if answer.match(regex)
ok "Resolved #{config[:domain]} #{config[:type]} matched #{regex}"
end
- end # b.each()
+ end
critical "Resolved #{config[:domain]} #{config[:type]} did not match #{regex}"
end
def check_results(entries)
errors = []