LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-22-2009, 01:16 PM   #1
s_linux
Member
 
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, 02:30 PM   #2
ramram29
Member
 
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, 03:10 PM   #3
David1357
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
Quote:
Originally Posted by s_linux View Post
Any one have an idea.
Code:
[user@machine:~] top -b -n 1 | grep Mem
[user@machine:~] top -b -n 1 | grep Cpu
From the man page:
Code:
       -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, 02:03 PM   #4
s_linux
Member
 
Registered: Jul 2009
Posts: 83

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


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
Can we monitor CPU & Memory usage of Windows boxes through RRDtool on Linux (RHEL 3)? sandeepgupte Linux - Software 1 09-19-2007 10:35 AM
Need Monitor the CPU, Memory and Disk Usage srikanthrao_d Linux - Software 2 12-28-2005 08:15 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08: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 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 03:23 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