summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/bin/ping_hosts.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/local/bin/ping_hosts.sh b/usr/local/bin/ping_hosts.sh
index 5e2f1c7..3858733 100755
--- a/usr/local/bin/ping_hosts.sh
+++ b/usr/local/bin/ping_hosts.sh
@@ -110,7 +110,7 @@ for TOPING in $PINGHOSTS ; do
echo "Ping returned $?"
echo $PINGTIME > /var/db/pingmsstatus/$DSTIP
if [ "$THRESHOLD" != "" ]; then
- if [ "$PINGTIME" -gt "$THRESHOLD" ]; then
+ if [ $(echo "${PINGTIME} > ${THRESHOLD}" | /usr/bin/bc) -eq 1 ]; 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
@@ -121,7 +121,7 @@ for TOPING in $PINGHOSTS ; do
echo "Checking wan ping time $WANTIME"
echo $WANTIME > /var/db/wanaverage
if [ "$WANTHRESHOLD" != "" ]; then
- if [ "$WANTIME" -gt "$WANTHRESHOLD" ]; then
+ if [ $(echo "${WANTIME} > ${WANTHRESHOLD}" | /usr/bin/bc) -eq 1 ]; 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
OpenPOWER on IntegriCloud