Build precise queries to find exactly what you need
Press ESC to close
Changed the following to get it to work and Date check if it’s unknown.
— /home/rmu/check_apc.pl 2013-07-31 13:29:08.893074154 +0200 +++ check_apc.pl 2013-08-02 10:06:06.328270476 +0200 @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +# This Script doesn’t work with the Embedded Perl from icinga, disable it: +# icinga: -epn # # check_apc.pl v1.0 # @@ -174,6 +176,10 @@ # If Okay, then check the date of the last self test before returning result of check # First the returned date is converted to epoch for simplified date math # UPS returns date as mm/dd/yyyy + if (lc($diag_date) eq “unknown”){ + print “WARNING: Unknown when self test run last timen”; + exit $WARNING; + }else{ my @diagdate_split = split(///,$diag_date); my $diagdate_epoch = timelocal(0,0,12,$diagdate_split[1],$diagdate_split[0] – 1,$diagdate_split[2]); my $diag_daysago = int((time – $diagdate_epoch) / 86400 + 0.5); # How many days since last self test @@ -188,6 +194,7 @@ print “OK: Self test passed on $diag_date ($diag_daysago days ago)n”; exit $OKAY; } + } } } case m/^load$|^load:d{2,5}$/{
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!