[rrd-users] Re: How get CPU and Memory values

Serge Maandag serge.maandag at staff.zeelandnet.nl
Fri Oct 7 23:39:05 MEST 2005

> But how can I calculate the processor load with the numbers 
> from /proc/stat ? 
> I didn't understand what they represent...  can you help me? 
> do you have an example script or the calcule to do this?

The contents of /proc/stat differ among kernel versions and among
linux distributions. But there's a man page. `man proc` is what you
are looking for.

For my old server it says:
(the mailinglist program is going to ruin the formatting of this)

    stat   kernel/system statistics

              cpu  3357 0 4313 1362393
                     The number of jiffies (1/100ths of a second) 
			   that the system spent in user mode, user mode

			   with low priority (nice), system mode, and
                     idle task, respectively.  The last value should 
			   be 100 times the second entry in the uptime 

Since it is a counter and it is counting 1/100th of a second, you can
take the number, put it in a COUNTER DS in your database and you 
automatically are storing the cpu usage in percent.

`cat /proc/stat` says:

root at blackbox# cat /proc/stat 
cpu  37636778 776 37294156 150024398
cpu0 18825283 409 18999739 74652623
cpu1 18811495 367 18294417 75371775


Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php

For the content of this e-mail message and its attachment(s) the following disclaimer applies: http://www.zeelandnet.nl/disclaimer.php

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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list