LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-21-2005, 04:38 AM   #1
simon's
LQ Newbie
 
Registered: May 2005
Posts: 2

Rep: Reputation: 0
looking for report cpu load


Hullo,
I'm looking for a software that create logs of cpu load.

Thank you.
 
Old 05-21-2005, 09:51 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
The command:

/usr/bin/top -b -d 1 -p 99 -n 999999999999 | \
/bin/grep --line-buffered Cpu > /var/log/CPU.log &

Will generate a log, at one second intervals, of the CPU load to the file '/var/log/CPU.log'. You can start this at boot in your distribution's appropriate script (e.g., '/etc/rc.d/rc.local'). You can change the interval for the samples, by changing the '-d' value on top. For example, '-d 5' will take samples at 5 second intervals.

Last edited by macemoneta; 05-21-2005 at 09:56 PM.
 
Old 05-21-2005, 10:11 PM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
If you want the date and time on each log entry, use:

/usr/bin/top -b -d 1 -p 99 -n 999999999999 | \
/bin/grep --line-buffered Cpu | \
/usr/bin/awk '{print strftime("%b %d %T %Z %Y"),$0}' > /var/log/CPU.log &

You can manipulate the entries and their format as you see fit.

Last edited by macemoneta; 05-21-2005 at 10:14 PM.
 
  


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
CPU Load Always at 100% freddie_leaf Debian 2 09-25-2005 07:59 AM
Sendmail and cpu load JJX Debian 3 01-30-2005 09:51 AM
strange cpu load mindcry Linux - Software 4 08-07-2004 12:57 AM
Why am I getting ?high? CPU load? pnh73 Linux - General 15 10-21-2003 11:36 AM
Question about CPU load iceman47 Linux - Hardware 8 05-29-2003 10:04 AM


All times are GMT -5. The time now is 02:21 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration