Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
SUSE / openSUSE This Forum is for the discussion of Suse Linux.


  Search this Thread
Old 07-22-2009, 02:16 PM   #1
Registered: Jul 2009
Posts: 83

Rep: Reputation: 15
script to monitor memory and cpu usage

Im just trying to write some script to caputre memory and cpu usage on SLES servers, I just wanna use "top |grep Mem" and "top |grep Cpu". when I ran the above command, it just keep going. i just want to get one line each for memory and cpu. Any one have an idea. Thanks
Old 07-22-2009, 03:30 PM   #2
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Better yet you can graph the result using a combination of SNMP and rddtools
Old 07-22-2009, 04:10 PM   #3
Senior Member
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Originally Posted by s_linux View Post
Any one have an idea.
[user@machine:~] top -b -n 1 | grep Mem
[user@machine:~] top -b -n 1 | grep Cpu
From the man page:
       -b : Batch mode operation
            Starts  top  in  'Batch  mode', which could be useful for
            sending output from top to other programs or to a file.
            In this mode, top will not accept input and runs until the
            iterations limit you've set with the '-n' command-line
            option or until killed.
Old 07-23-2009, 03:03 PM   #4
Registered: Jul 2009
Posts: 83

Original Poster
Rep: Reputation: 15
Thanks it works!!


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
Can we monitor CPU & Memory usage of Windows boxes through RRDtool on Linux (RHEL 3)? sandeepgupte Linux - Software 1 09-19-2007 11:35 AM
Need Monitor the CPU, Memory and Disk Usage srikanthrao_d Linux - Software 2 12-28-2005 09:15 AM
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
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 06:55 AM

All times are GMT -5. The time now is 12:02 PM.

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