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 "root" <$filename | fgrep -v "USER" | sort -r +6 |head -9
sleep 15
clear
uptime
echo " "
echo " Defunct processes"
echo
fgrep defunct <$filename | fgrep -v fgrep
echo
sleep 5
#ps -ef | grep -v "root" | grep -v "rf0" | grep -v "rf1" | grep -v "rf2" | gr
ep -v "rf3" | grep -v "mms6008" | grep -v "usr/lib/lpd/pio" | grep " - " > $file
name
fgrep " - " <$filename | fgrep -v " root " | grep -v " rf. " | fgrep -v " mm
s6008 " | fgrep -v "usr/lib/lpd/pio" > $sortfile
if [ -s $sortfile ] ; then
clear
uptime
echo " "
echo " User Processes not attached to a tty"
echo " "
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 " Print Status"
# echo " "
# cat $sortfile
# rm -f $filename
# rm -f $sortfile
# sleep 5
#fi
# done
exit
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 "root" <$filename | fgrep -v "USER" | sort -r +6 |head -9
sleep 15
clear
uptime
echo " "
echo " Defunct processes"
echo
fgrep defunct <$filename | fgrep -v fgrep
echo
sleep 5
#ps -ef | grep -v "root" | grep -v "rf0" | grep -v "rf1" | grep -v "rf2" | gr
ep -v "rf3" | grep -v "mms6008" | grep -v "usr/lib/lpd/pio" | grep " - " > $file
name
fgrep " - " <$filename | fgrep -v " root " | grep -v " rf. " | fgrep -v " mm
s6008 " | fgrep -v "usr/lib/lpd/pio" > $sortfile
if [ -s $sortfile ] ; then
clear
uptime
echo " "
echo " User Processes not attached to a tty"
echo " "
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 " Print Status"
# echo " "
# cat $sortfile
# rm -f $filename
# rm -f $sortfile
# sleep 5
#fi
# done
exit