From 8f105c8a9e36c5b84eef754638dd963f50995fec Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 24 Dec 2013 12:07:24 -0200 Subject: Save status even if no script is executed --- usr/local/bin/ping_hosts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr') diff --git a/usr/local/bin/ping_hosts.sh b/usr/local/bin/ping_hosts.sh index c8538a6..5e2f1c7 100755 --- a/usr/local/bin/ping_hosts.sh +++ b/usr/local/bin/ping_hosts.sh @@ -88,9 +88,9 @@ for TOPING in $PINGHOSTS ; do if [ "$SERVICERESTOREDSCRIPT" != "" ]; then echo "$DSTIP is UP, previous state was DOWN .. Running $SERVICERESTOREDSCRIPT" echo "$DSTIP is UP, previous state was DOWN .. Running $SERVICERESTOREDSCRIPT" | logger -p daemon.info -i -t PingMonitor - echo "UP" > /var/db/pingstatus/$DSTIP sh -c $SERVICERESTOREDSCRIPT fi + echo "UP" > /var/db/pingstatus/$DSTIP fi else # Host is down @@ -99,9 +99,9 @@ for TOPING in $PINGHOSTS ; do if [ "$FAILURESCRIPT" != "" ]; then echo "$DSTIP is DOWN, previous state was UP .. Running $FAILURESCRIPT" echo "$DSTIP is DOWN, previous state was UP .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor - echo "DOWN" > /var/db/pingstatus/$DSTIP sh -c $FAILURESCRIPT fi + echo "DOWN" > /var/db/pingstatus/$DSTIP fi fi echo "Checking ping time $DSTIP" -- cgit v1.1