bin/check-certificate-expiry.rb in sensu-plugins-aws-2.1.0 vs bin/check-certificate-expiry.rb in sensu-plugins-aws-2.1.1
- old
+ new
@@ -87,14 +87,14 @@
current_time = Time.now.gmtime
time_to_expiry = (expiration - current_time).to_i / (24 * 60 * 60) ## Seconds to days, integer division
if time_to_expiry <= config[:critical].to_i
critflag = true
- if time_to_expiry < 1
- reportstring += " #{cert.server_certificate_name} certificate is expired!"
- else
- reportstring += " #{cert.server_certificate_name} certificate expires in #{time_to_expiry} days;"
- end
+ reportstring += if time_to_expiry < 1
+ " #{cert.server_certificate_name} certificate is expired!"
+ else
+ " #{cert.server_certificate_name} certificate expires in #{time_to_expiry} days;"
+ end
elsif time_to_expiry <= config[:warning].to_i
warnflag = true
reportstring += " #{cert.server_certificate_name} certificate expires in #{time_to_expiry} days;"
end
[reportstring, warnflag, critflag]