Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i monitor the process memory or cpu effort ????

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can i monitor the process memory or cpu effort ?
Which is the shell command that let me do this ??
Is there an option of "ps" shell command??
I'm working on unix server: Sun Solaris 2.7.

Thank you in advance for your help
bye
Andrea
 
Hi
You can use sar -u 5 10 this means that it will check the load placed on your cpu every five seconds and will run ten times give you an average % for it.

Regards

Simon Simon Peter Wickham
Email: s.wickham@zoom.co.uk
 
Andrea,

The top command gives you the information you're asking for in an easy to read format.
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Mike's right about Top, but it's not always available on Solaris media for some reason. You can download it from Alternatively, cut and paste the following script )provided by one of the kind people on here, but I can never remember who:

#!/bin/sh
############################################################
PS=/bin/ps
CUT=/usr/bin/cut
SORT=/usr/bin/sort
HEAD=/usr/bin/head

if [ -x $PS -a -x $CUT -a -x $SORT -a -x $HEAD ]
then
echo
echo " %CPU PID TIME VSZ USER COMMAND"
echo
$PS -aef -o pcpu= -o pid= -o time= -o vsz= -o user= -o args= |
$CUT -c -130 | $SORT -r | $HEAD -10
else
exit 1
fi

Hope this helps.
 
An old favourite: -

/usr/ucb/ps -aux | head 10 (10 highest cpu processes )

/usr/ucb/ps -auv | haed 10 (memory processes)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top