I am using snmpget to retrieve raw information from:
ssCpuRawIdle.0
ssCpuRawUser.0
ssCpuRawSystem.0
As I understand they are on 32 bit counters. I also use ifOutOctets and ifInOctets to retrieve the information for network statistics over a period of 60 seconds and then run this equation:
value_1 = 1st reading before 60 second sleep
value 2 = 2nd reading after 60 second sleep
PERIOD = 60
value_1=$1
value_2=$2
if (($value_2 < $value_1)); then
value_2=$(($value_2 + 4294967296))
fi
RATE=$( bc <<< "scale=2; ($value_2 - $value_1)/$PERIOD")
VALUE=$( bc <<< "scale=2; $RATE * 8")
I was wondering if there is a necessity to do this with the cpu statistics and if so, does anyone know the calculation?