Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
@ftrahan
Favorites0
Views
Projects0
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/..*//'`
Reviewed 12 years ago