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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitoring script

Status
Not open for further replies.

terrapin

MIS
May 4, 2000
21
US
Here is a monitoring script that I would like for you to evaluate and give your opinion
if you think I should not run this script because in itself it takes up to much cpu resources please give your advice !

while true
do
uptime
echo "****THE TOP 10 PROCESSES THAT HAVE THE MOST RECENT CPU USAGE****"
ps -ef|head -n 1;ps -ef|egrep -v "C|0:00|\ 0\ "|sort +3b -4 -n -r|head -n 10
sleep 5
clear
echo "****THE TOP 10 PROCESSES THAT HAVE ACCUMULATED THE MOST CPU TIME****"
ps -ef|head -n 1;ps -e|egrep -v "TIME|0:"|sort +2b -3 -n -r|head -n 10
sleep 5
clear
echo "****THE TOP 10 PROCESSES THAT HAVE THE MOST CPU USAGE****"
ps gu|head -n 1;ps gu|egrep -v "CPU|kproc"|sort +2b -3 -n -r|head -n 10
sleep 5
clear
echo "****THE TOP 10 ALLOCATED CPU TIME TO A PROCESS SINCE STARTED****"
ps au|head -n 10
sleep 5
clear
lpstatlocal
lpstat -a000
lpstat -a001
lpstat -a002
lpstat -a003
sleep 5
clear
done
exit
 
Terrapin,

Check out the [tt]monitor[/tt] utility. It will give you all of this info (and the stuff from the other script) plus other stuff as well. 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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top