I have a script that looks like this:
it works fine but I have it running every 15 minutes through cron and when my condition is met I get 4 pages an hour until it has been resolved. Can someone please assist me in getting this script to run every 15 minutes and only page me once???? Thanks
## This portion of the script monitors power to SP nodes
##
spmon -d|awk '{print $2":"$4}' > /tmp/mon_power.out
grep off /tmp/mon_power.out > /tmp/mon_power2.out
if [ $? -eq 0 ]
then mail -s "SP node power out msg" 4556720@archwireless.net < /tmp/mon_sp_powe
r2.out
mail -s "SP node power out msg" 4550720@archwireless.net < /tmp/mon_sp_power2.ou
t
fi
it works fine but I have it running every 15 minutes through cron and when my condition is met I get 4 pages an hour until it has been resolved. Can someone please assist me in getting this script to run every 15 minutes and only page me once???? Thanks
## This portion of the script monitors power to SP nodes
##
spmon -d|awk '{print $2":"$4}' > /tmp/mon_power.out
grep off /tmp/mon_power.out > /tmp/mon_power2.out
if [ $? -eq 0 ]
then mail -s "SP node power out msg" 4556720@archwireless.net < /tmp/mon_sp_powe
r2.out
mail -s "SP node power out msg" 4550720@archwireless.net < /tmp/mon_sp_power2.ou
t
fi