summaryrefslogtreecommitdiffstats
path: root/usr/local/bin
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2011-02-05 03:10:26 -0500
committerChris Buechler <cmb@pfsense.org>2011-02-05 03:10:26 -0500
commit9fcf15773caa87261314bfe6e8a33a3f0d1d18bd (patch)
tree6648cda4081de0ab28bde81fb0359cf7f4ea0dd9 /usr/local/bin
parente5a30665e9dc98d9ab1157c425b3d002dceed21d (diff)
downloadpfsense-9fcf15773caa87261314bfe6e8a33a3f0d1d18bd.zip
pfsense-9fcf15773caa87261314bfe6e8a33a3f0d1d18bd.tar.gz
the only thing ping_hosts.sh is used for is pinging IPsec hosts. comment out all this complexity that makes it do way more than it needs to (and was throwing an error on rrd, it shouldn't be touching rrd)
Diffstat (limited to 'usr/local/bin')
-rwxr-xr-xusr/local/bin/ping_hosts.sh100
1 files changed, 50 insertions, 50 deletions
diff --git a/usr/local/bin/ping_hosts.sh b/usr/local/bin/ping_hosts.sh
index 8455015..1d893c2 100755
--- a/usr/local/bin/ping_hosts.sh
+++ b/usr/local/bin/ping_hosts.sh
@@ -69,56 +69,56 @@ for TOPING in $PINGHOSTS ; do
echo Processing $DSTIP
# Look for a service being down
ping -c $COUNT -S $SRCIP $DSTIP
- if [ $? -eq 0 ]; then
- # Host is up
- # Read in previous status
- PREVIOUSSTATUS=`cat /var/db/pingstatus/$DSTIP`
- if [ "$PREVIOUSSTATUS" = "DOWN" ]; then
- # Service restored
- 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
- sh -c $SERVICERESTOREDSCRIPT
- fi
- fi
- echo "UP" > /var/db/pingstatus/$DSTIP
- else
- # Host is down
- PREVIOUSSTATUS=`cat /var/db/pingstatus/$DSTIP`
- if [ "$PREVIOUSSTATUS" = "UP" ]; then
- # Service is down
- 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
- sh -c $FAILURESCRIPT
- fi
- fi
- echo "DOWN" > /var/db/pingstatus/$DSTIP
- fi
- echo "Checking ping time $DSTIP"
- # Look at ping values themselves
- PINGTIME=`ping -c 1 -S $SRCIP $DSTIP | awk '{ print $7 }' | grep time | cut -d "=" -f2`
- echo "Ping returned $?"
- echo $PINGTIME > /var/db/pingmsstatus/$DSTIP
- if [ "$THRESHOLD" != "" ]; then
- if [ "$PINGTIME" -gt "$THRESHOLD" ]; then
- echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT"
- echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor
- sh -c $FAILURESCRIPT
- fi
- fi
- # Wan ping time threshold
- WANTIME=`rrdtool fetch /var/db/rrd/wan-quality.rrd AVERAGE -r 120 -s -1min -e -1min | grep ":" | cut -f3 -d" " | cut -d"e" -f1`
- echo "Checking wan ping time $WANTIME"
- echo $WANTIME > /var/db/wanaverage
- if [ "$WANTHRESHOLD" != "" ]; then
- if [ "$WANTIME" -gt "$WANTHRESHOLD" ]; then
- echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT"
- echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor
- sh -c $FAILURESCRIPT
- fi
- fi
- sleep 1
+# if [ $? -eq 0 ]; then
+# # Host is up
+# # Read in previous status
+# PREVIOUSSTATUS=`cat /var/db/pingstatus/$DSTIP`
+# if [ "$PREVIOUSSTATUS" = "DOWN" ]; then
+# # Service restored
+# 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
+# sh -c $SERVICERESTOREDSCRIPT
+# fi
+# fi
+# echo "UP" > /var/db/pingstatus/$DSTIP
+# else
+# # Host is down
+# PREVIOUSSTATUS=`cat /var/db/pingstatus/$DSTIP`
+# if [ "$PREVIOUSSTATUS" = "UP" ]; then
+# # Service is down
+# 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
+# sh -c $FAILURESCRIPT
+# fi
+# fi
+# echo "DOWN" > /var/db/pingstatus/$DSTIP
+# fi
+# echo "Checking ping time $DSTIP"
+# # Look at ping values themselves
+# PINGTIME=`ping -c 1 -S $SRCIP $DSTIP | awk '{ print $7 }' | grep time | cut -d "=" -f2`
+# echo "Ping returned $?"
+# echo $PINGTIME > /var/db/pingmsstatus/$DSTIP
+# if [ "$THRESHOLD" != "" ]; then
+# if [ "$PINGTIME" -gt "$THRESHOLD" ]; then
+# echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT"
+# echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor
+# sh -c $FAILURESCRIPT
+# fi
+# fi
+# # Wan ping time threshold
+# WANTIME=`rrdtool fetch /var/db/rrd/wan-quality.rrd AVERAGE -r 120 -s -1min -e -1min | grep ":" | cut -f3 -d" " | cut -d"e" -f1`
+# echo "Checking wan ping time $WANTIME"
+# echo $WANTIME > /var/db/wanaverage
+# if [ "$WANTHRESHOLD" != "" ]; then
+# if [ "$WANTIME" -gt "$WANTHRESHOLD" ]; then
+# echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT"
+# echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor
+# sh -c $FAILURESCRIPT
+# fi
+# fi
+# sleep 1
done
exit 0
OpenPOWER on IntegriCloud