Connecting Tech Pros Worldwide Forums | Help | Site Map

how to get current CPU load in redhat?

Tarantulus's Avatar
Member
 
Join Date: May 2007
Posts: 103
#1: Apr 24 '09
Hi all,

I feel like an idiot for asking this but I just can't seem to get it. I'm trying to extract the current CPU load (not average) from a redhat box and put it into a variable in a shellscript.

I've tried various combinations of "top -b" and the like, but it's not working, I mean, I get the figures, but they are always the same (and therefore not accurate).

any thoughts?

micmast's Avatar
Familiar Sight
 
Join Date: Mar 2008
Location: Belgium
Posts: 137
#2: Apr 24 '09

re: how to get current CPU load in redhat?


You should be able to find the information in /proc/stat
However you might have to do some research on what the columns mean
Tarantulus's Avatar
Member
 
Join Date: May 2007
Posts: 103
#3: Apr 24 '09

re: how to get current CPU load in redhat?


thanks, it seems odd that there is no way to do this, I'd have expected it to be a fairly standard request!
Nepomuk's Avatar
Moderator
 
Join Date: Aug 2007
Location: Germany
Posts: 2,466
#4: Apr 24 '09

re: how to get current CPU load in redhat?


Hm, the sysstat package seems to do that - have a look there.

Greetings,
Nepomuk
Reply


Similar Unix / Linux / BSD bytes