Process Scheduler Monitor Script - Logic
Sharing my simple script created to monitor the status of the PRCS scheduler services.
1. PRCS-List.txt is a file referred by my logic which contains PRCS Domain names which we have to monitor…
[Sandeep]:/dba/scripts>cat PRCS-List.txt
SANDEEP
SANSNEW
[Sandeep]:/dba/scripts>
Script starts here….
ScriptPath="/dba/scripts”
rm $ScriptPath/PRCS-Report.txt
cat $ScriptPath/PRCS-List.txt while read line
do
psadmin -p status -d $line > $ScriptPath/PRCS-TMP.txt
status=`egrep 'BBLPSPRCSRVPSDSTSRV' $ScriptPath/PRCS-TMP.txt wc -l`
if [ ${status} -ne 3 ]
then
echo "" >> $ScriptPath/PRCS-Report.txt
echo $line >> $ScriptPath/PRCS-Report.txt
`echo "Process Scheduler is DOWN" >> $ScriptPath/PRCS-Report.txt`
echo "" >> $ScriptPath/PRCS-Report.txt
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" >> $ScriptPath/PRCS-Report.txt
else
#echo $status >> $ScriptPath/PRCS-Report.txt
echo "" >> $ScriptPath/PRCS-Report.txt
echo $line >> $ScriptPath/PRCS-Report.txt
`echo "Up & Running" >> $ScriptPath/PRCS-Report.txt`
echo "" >> $ScriptPath/PRCS-Report.txt
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" >> $ScriptPath/PRCS-Report.txt
fi
done
Script Output - PRCS-Report.txt will look as below; you can e-mail this to your ID from the UNIX Server….
SANDEEP
Up & Running
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SANSNEW
Process Scheduler is DOWN
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++