bin/check-elb-certs.rb in sensu-plugins-aws-0.0.1.alpha.2 vs bin/check-elb-certs.rb in sensu-plugins-aws-0.0.1
- old
+ new
@@ -29,11 +29,10 @@
# Copyright (c) 2013, Peter Burkholder, pburkholder@pobox.com
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
#
-require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/check/cli'
require 'aws-sdk'
require 'net/http'
require 'openssl'
@@ -88,11 +87,11 @@
if config[:aws_access_key] && config[:aws_secret_access_key]
hash.update region: config[:aws_region]
hash
end
- def run
+ def run # rubocop:disable all
ok_message = []
warning_message = []
critical_message = []
AWS.start_memoizing
@@ -114,10 +113,10 @@
rescue => e
critical "An issue occurred attempting to get cert: #{e.message}"
end
cert_days_remaining = ((cert.not_after - Time.now) / 86_400).to_i
- message = sprintf '%s(%d)', lb.name, cert_days_remaining
+ message = sprintf '%s(%d)', lb.name, cert_days_remaining # rubocop:disable all
if config[:crit_under] > 0 && config[:crit_under] >= cert_days_remaining
critical_message << message
elsif config[:warn_under] > 0 && config[:warn_under] >= cert_days_remaining
warning_message << message