Thanks _Ric, that script looks like it will work brilliantly once i've got it working, which is why it's taken me so long to get back.
One thing i'm having trouble with at the moment is calculating the percentage, see code below:
the host name shows correctly but everything else is blank.
MAX=`snmpget -O Uvbqs -v 1 -c Public $host $oidmax
REST=`snmpget -O Uvbqs -v 1 -c Public $host $oidcur
CURRENT=`expr $MAX - $REST`
CURPERCENT=`expr $CURRENT "*" $HUNDRED "/" $MAX`
echo "OK - $host: $CURRENT / $CURPERCENT% | Pages=$CURRENT
For testing i've tried:
MAX and REST show up the correct values but CURRENT and CURPERCENT don't.
echo "MAX=$MAX REST=$REST CURRENT=$CURRENT CURPERCENT=$CURPERCENT"
I figured maybe expr wasnt working correctly but changing it to:
Correctly gives 11 but:
CURRENT=`expr 10 + 1`
is blank. Seems to be an issue with doing an expression on a variable. Any ideas anybody?
CURRENT=`expr $HUNDRED + 1`