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

Monitoring script 2

Status
Not open for further replies.

terrapin

MIS
May 4, 2000
21
US
Here is another script to evaluate please give your advice to which monitoring script is more effecient?

filename=/tmp/bigtimeA$$X
sortfile=/tmp/bigtimeB$$X
filename=/tmp/bigtimeA$$X

# Remove work files when shell program exists, or if the user logs out,
# presses CTRL-C, or does a kill
trap "rm -f /tmp/bigtime?$$X; exit" 0 1 2 15

#while true
# do
ps -ef >$filename
#
#ps -ef | grep -v "root" | grep -v "USER" | sort -r +6 |head -9 > $filename
clear
uptime
echo " "
echo " * * * * Top User Processes * * * *"
echo " "
fgrep -v &quot;root&quot; <$filename | fgrep -v &quot;USER&quot; | sort -r +6 |head -9
sleep 15
clear
uptime
echo &quot; &quot;
echo &quot; Defunct processes&quot;
echo
fgrep defunct <$filename | fgrep -v fgrep
echo
sleep 5
#ps -ef | grep -v &quot;root&quot; | grep -v &quot;rf0&quot; | grep -v &quot;rf1&quot; | grep -v &quot;rf2&quot; | gr
ep -v &quot;rf3&quot; | grep -v &quot;mms6008&quot; | grep -v &quot;usr/lib/lpd/pio&quot; | grep &quot; - &quot; > $file
name
fgrep &quot; - &quot; <$filename | fgrep -v &quot; root &quot; | grep -v &quot; rf. &quot; | fgrep -v &quot; mm
s6008 &quot; | fgrep -v &quot;usr/lib/lpd/pio&quot; > $sortfile
if [ -s $sortfile ] ; then
clear
uptime
echo &quot; &quot;
echo &quot; User Processes not attached to a tty&quot;
echo &quot; &quot;
cat $sortfile
sleep 7
fi
monitor -alternative -top -Count 5 -sample 3
sleep 5
#lpstat > $filename
monitor -alternative -disk -Count 4 -sample 3
sleep 3

#grep -v READY $filename > $sortfile
#if [ -s $sortfile ] ; then
# clear
# echo &quot; Print Status&quot;
# echo &quot; &quot;
# cat $sortfile
# rm -f $filename
# rm -f $sortfile
# sleep 5
#fi
# done
exit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top