I have a script. It works fine, except I have it running through CRON every 5 minutes and when it encounters a process that is down, I get a page every five minutes.I'd like CRON to run the script every five minutes but I want to get paged every hour when a problem is encountered. Does anyone have any suggestions???? Thanks
cat oradbproc.lis | while read LINE
do
SERVER=`echo $LINE|cut -f1 -d :`
PROC=`echo $LINE|cut -f2 -d :`
USER=`echo $LINE|cut -f3 -d :`
MAILMSG=`echo $LINE|cut -f4 -d :`
RC=1
ping -c 5 "$SERVER" 1>/dev/null 2>/dev/null
if [ $? = 1 ]
then
clear
echo "\n\n\n"
echo "Server: "$SERVER" is not available......\n"
echo "Contact UNIX Support.....\n\n\n"
set $RC=0
else
dsh -w "$SERVER" ps -ef|grep "$PROC"|grep "$USER"|grep -v grep 1>/dev/null 2>/
dev/null
if [ $? = 1 ]
then
echo "$MAILMSG"|mail -s ORACLE ALERT 444-5555@archwireless.net
set $RC=0
fi
fi
done
cat oradbproc.lis | while read LINE
do
SERVER=`echo $LINE|cut -f1 -d :`
PROC=`echo $LINE|cut -f2 -d :`
USER=`echo $LINE|cut -f3 -d :`
MAILMSG=`echo $LINE|cut -f4 -d :`
RC=1
ping -c 5 "$SERVER" 1>/dev/null 2>/dev/null
if [ $? = 1 ]
then
clear
echo "\n\n\n"
echo "Server: "$SERVER" is not available......\n"
echo "Contact UNIX Support.....\n\n\n"
set $RC=0
else
dsh -w "$SERVER" ps -ef|grep "$PROC"|grep "$USER"|grep -v grep 1>/dev/null 2>/
dev/null
if [ $? = 1 ]
then
echo "$MAILMSG"|mail -s ORACLE ALERT 444-5555@archwireless.net
set $RC=0
fi
fi
done