LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-03-2006, 10:50 AM   #1
mikz
Member
 
Registered: Sep 2004
Distribution: Slackware current
Posts: 109

Rep: Reputation: 15
Monitoring CPU in %


How do i see what the CPU usage is in % from the command line.? I have already tried TOP, but I need something simpler.
 
Old 03-03-2006, 10:53 AM   #2
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
you could try
Code:
vmstat
seems simpler though looks quite featuresless to me
 
Old 03-03-2006, 11:06 AM   #3
mikz
Member
 
Registered: Sep 2004
Distribution: Slackware current
Posts: 109

Original Poster
Rep: Reputation: 15
would it be possible to pipe the first 5 lines of the results from a 'TOP' command into a text file.
I've tried TOP > toptest.txt, but the TOP program just keeps hanging.
 
Old 03-03-2006, 11:20 AM   #4
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
I got this from man top

Code:
top -b -n 1 > topfile
though it gives the full output, you might want to read the man in order to get properly what you want
 
Old 03-03-2006, 11:50 AM   #5
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
You could also do:

watch vmstat

want to know what it does?

man watch

Unfortunately it (vmwatch) deals only with memory, not CPU utilization. I searched and could not find any utilities to dump CPU utilization of the moment. There is documentation on the system calls (obviously) for each item you want to watch, and the source for "top" is readily available, so it wouldn't be a huge project to lift some of the code out of top, put together a vmstat-like utility which takes a CPU utilization snapshot of the moment and display a summary. You can then use watch to keep a constantly-updated view of the system.

There are of course X solutions like superkaramba, kwatch, xos, and the like, but obviously running those via X over SSH is computationally expensive so a console app is a better solution.

With all of that said: what's wrong with top? what is it in top which makes it inappropriate? Maybe if we do some digging we could find something more suitable for you.

Last edited by KimVette; 03-03-2006 at 12:02 PM.
 
Old 03-03-2006, 11:59 AM   #6
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Quote:
Originally Posted by KimVette
Unfortunately it deals only with memory, not CPU utilization.
Yes, vmstat does check CPU utilization
 
  


Reply



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
cpu monitoring saavik Linux - Networking 2 03-30-2005 05:11 AM
CPU Utilization / Performance Monitoring codegomer Linux - General 3 02-18-2004 12:35 PM
CPU fanspeed monitoring! DVDke Linux - Software 0 05-11-2003 10:03 AM
CPU Monitoring and Notification flinchbot Linux - General 1 02-03-2003 04:05 PM
Monitoring CPU temp.? NSKL Linux - General 28 06-21-2002 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

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
Open Source Consulting | Domain Registration