You are on page 1of 1

#!

/bin/ksh
# set -x
. /nsr/scripts/.profile

CURRENT_TIME_EPOCH=`date +%s`
CURRENTHOUR=`date +"%H"`
CURRENTMINUTE=`date +"%M"`
if [ $1 ] && [ $1 = NO_MANUAL_RUN ] && [ $CURRENTMINUTE = 25 ] || [ $CURRENTMINUTE
= 55 ]
then
echo "Proceeding..." >/dev/null
else
echo "Exiting...Running this script manually is prohibited"
exit
fi

ls /nsr/scripts/.lock_check* >> /dev/null 2>&1


if [ $? = 0 ]
then
echo "nsradmin error : Cannot Contact Backup Server MV3WBKSV01PRV. Appears
that backup server is Hung or Down. Please check status manually and investigate if
there is an issue." | /bin/mailx -s "mv3wbksv01prv.smrc.sidra.org's ATWE
notification,Hostname: mv3wbksv01prv, Profile: Custom, Severity: 2"
mwahajuddin@sidra.org,mhouhou@sidra.org,sawad@sidra.org,ptummala.dell@sidra.org,pra
veen_tummala@dellteam.com,Arvind_K_Soni@Dell.com,Animesh_Kumar@Dell.com,Sandeep_Bat
ra@Dell.com,dl-sidra-backup@dell.com,atwe_sid_networker@dell.com -- -f
networker@sidra.org
exit
else
touch /nsr/scripts/.lock_check
chmod 600 /nsr/scripts/.lock_check
fi
trap "rm /nsr/scripts/.lock_check;echo interrupted...;exit" 2

echo help | nsradmin -s mv3wbksv01prv-prod.smrc.sidra.org -i - >/dev/null 2>&1


if [ $? -eq 0 ]
then
logger "nsradmin notice : Backup Server MV3WBKSV01PRV is alive"
else
sleep 60
echo help | nsradmin -s mv3wbksv01prv.smrc.sidra.org -i - >/dev/null 2>&1
if [ $? -eq 0 ]
then
logger "nsradmin notice : Backup Server MV3WBKSV01PRV is alive"
else
logger "nsradmin notice : Backup Server MV3WBKSV01PRV is not responding"
echo "nsradmin error : Cannot Contact Backup Server MV3WBKSV01PRV. Appears
that backup server is Hung or Down. Please check status manually and investigate if
there is an issue." | /bin/mailx -s "mv3wbksv01prv.smrc.sidra.org's ATWE
notification,Hostname: mv3wbksv01prv, Profile: Custom, Severity: 2"
mwahajuddin@sidra.org,mhouhou@sidra.org,sawad@sidra.org,ptummala.dell@sidra.org,pra
veen_tummala@dellteam.com,Arvind_K_Soni@Dell.com,Animesh_Kumar@Dell.com,Sandeep_Bat
ra@Dell.com,dl-sidra-backup@dell.com,atwe_sid_networker@dell.com -- -f
networker@sidra.org
fi
fi

rm /nsr/scripts/.lock_check

You might also like