LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   check overall cpu usage (https://www.linuxquestions.org/questions/linux-newbie-8/check-overall-cpu-usage-886786/)

franklin.sucre 06-16-2011 07:47 PM

check overall cpu usage
 
Dear all,

I wonder to know the command or the procedure to get the overall CPU utilisation in linux. I have used top, iostat, mpstat but the outputs are not the way i needed. Is it possible to get the output like...

CPU usage: .....% or something like that.

Thanks in advance.

Regards,
Franklin

bsdunix 06-16-2011 08:45 PM

Found this script Calculating CPU Usage from /proc/stat; saved it to a file, made it executable, and it worked.

Tinkster 06-16-2011 11:49 PM

Quote:

Originally Posted by bsdunix (Post 4388099)
Found this script Calculating CPU Usage from /proc/stat; saved it to a file, made it executable, and it worked.

It will give skewed results, though; he iterates over the entire line
"^cpu" and adds up values. Only the first 4 are actually relevant,
there's no point in adding softirq, irq, steal and such to the CPU.


Cheers,
Tink


All times are GMT -5. The time now is 03:12 AM.