Build precise queries to find exactly what you need
Press ESC to close
High. Nice script. Though I found a little bug.
When you clean leading zeros, you clean to many of them and a value of “0.0” becomes “.0” which is not detected by your script…
Here’s a patch :
— check_apcupsd.old 2013-12-02 10:20:28.395006242 -0500 +++ check_apcupsd 2013-12-02 10:20:59.751405840 -0500 @@ -158,7 +158,7 @@
VALUE=`$APCACCESS status $HOSTNAME:$PORT | grep -i ^$ARG | sed ‘s/.*: *([0-9.][0-9.]*)[^0-9.].*/1/’` -if [ “$VALUE” != “0” ]; then +if [ “$VALUE” != “0” -a “$VALUE” != “0.0” ]; then VALUE=`echo $VALUE | sed ‘s/^0*//’` fi ROUNDED=`echo $VALUE | sed ‘s/..*//’`
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!