[rrd-users] Re: Cpu usage %

Marek Dohojda marek.dohojda at linksys.com
Fri Mar 21 22:59:23 MET 2003


Hmmm moderator didn't like my quoting.

Ok the formula below didn't work.  I compilied a kernel and it showed no
usage, and yet top was showing over 20% usage of CPU.

here is my program (dirty just for testing, edited) to see the numbers and
they don't match..

#!/bin/bash

a=`snmpget -v 2c -c ***** $IP .ssCpuRawSystem.0 | awk -F: '{print $2}'`
b=`snmpget -v 2c -c ***** $IP .ssCpuRawUser.0 | awk -F: '{print $2}'`
c=`snmpget -v 2c -c ***** $IP .ssCpuRawIdle.0 | awk -F: '{print $2}'`

d=$(($a + $b + $c))
echo "Idle time"
echo  $c / $d | bc -l
echo "user time"
echo  $b / $d | bc -l
echo "system time"
echo  $b / $d | bc -l

-----Original Message-----
From: Stephan Harren [mailto:sh at abovenet.de]
Sent: Friday, March 21, 2003 11:24 AM
To: Marek Dohojda
Subject: Re: [rrd-users] Re: Cpu usage %


Yep

Marek Dohojda schrieb:

>Hello
>
>Am I wrong in assuming that if I do this math I will be correct?:
>	ssCpuRawSystem + ssCpuRawUser + ssCpuRawIdle = Total
>	then
>	(ssCpuRawSystem / Total) * 100 = % of System utilization 
>	
>Is that correct?

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list