[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 71243
  • Last Modified:

How to monitor CPU Usage

I would like to ask if there is any command that I can monitor CPU Usage in Redhat 7.1 .
0
mikekwok
Asked:
mikekwok
1 Solution
 
sunnycoderCommented:
Hi mikekwok,

top

Sunnycoder
0
 
paullamhkgCommented:
Sunnycoder is correct 'top' is the command you need

top - display top CPU processes

and the result will be something like this

 17:09:21  up 1 day,  3:17,  1 user,  load average: 0.00, 0.00, 0.00
62 processes: 60 sleeping, 2 running, 0 zombie, 0 stopped
CPU states:   1.1% user   0.0% system   0.0% nice   0.0% iowait  98.8% idle
Mem:   126044k av,  122612k used,    3432k free,       0k shrd,   50008k buff
                     92240k actv,       0k in_d,    1244k in_c
Swap: 1044144k av,    3560k used, 1040584k free                   25484k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

so it's not only for CPU, it's also for RAM usage and swap space and which application using how many CPU and RAM/SWAP.

man top to get more detal :)
0
 
willy134Commented:
do you have xload installed

xload is a classic unix tool that graphs the cpu usage so you can see trends.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mikekwokAuthor Commented:
how can i check if i have installed xload?
how to use it ?
0
 
sunnycoderCommented:
mikekwok,

Did you try top ?

On your command line prompt, type "top" and hit enter...

xload, I guess, is used in the same way ... on your command promt in an xterminal (not on console) type xload and hit enter
0
 
mikekwokAuthor Commented:
i have tried top. Thanks. will top generate log file for me to monitor the cpu usage ?
0
 
sunnycoderCommented:
Top will not generate a log file .. it will give you current statistics every five minutes or so ...

read the man page for detailed information

man top
0
 
mariocarboneCommented:
you can install sar command then you write "sar 10 1080 -o sarlog.bin" 1080 times every 10 seconds= 3 hours it will give you a binary log file called sarlog.bin after that to transform the binary log to a text format log you must write "sar -f sarlog.bin > sarlog.log"

I hope this right for you!
0
 
drubarthCommented:
You should use mrtg for monitoring CPU, Memory, Load Average, and more over time.  It shows graphs for daily, weekly, monthly, and yearly monitoring. You can find more info here:

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/

Good luck!
0
 
mikekwokAuthor Commented:
i know that MRTG is good .
do u have any website teaching me hwo to install MRTG?
Thanks.
I would like to monitor my linksys router using mrtg but i dunno how to set . Would you please help me ? Thanks.
0
 
LawkieCommented:
Above is all pretty old, go for http://www.cacti.net/
It's easy and pretty powerful, let me know if you need further assistance.

Kind regards,

Rense
0
 
unvanquishableAbhayCommented:
Top should just solve the purpose.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now