LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2011, 08:47 PM   #1
franklin.sucre
LQ Newbie
 
Registered: Nov 2010
Location: vadgaon
Posts: 12

Rep: Reputation: 0
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
 
Old 06-16-2011, 09:45 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 80
Found this script Calculating CPU Usage from /proc/stat; saved it to a file, made it executable, and it worked.
 
Old 06-17-2011, 12:49 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by bsdunix View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
generate snmp trap to check High CPU Usage...... dashang.trivedi Linux - Networking 2 03-17-2011 03:51 AM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 02:14 PM
How to check the CPU usage in solaris? sunram Solaris / OpenSolaris 7 11-19-2008 03:02 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 05:45 AM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration