From a951875c8ffca05e6ff373fe266cb665fd514012 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Thu, 8 Jan 2015 23:08:09 +0100 Subject: [PATCH] replace ping by nc to circumvent errors when ICMP requests are blocked on a remote host --- monitor.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monitor.sh b/monitor.sh index 009b639..9fddad0 100755 --- a/monitor.sh +++ b/monitor.sh @@ -31,7 +31,11 @@ function mailsend { } function pingtest { - ping -c3 -W3 -q $1 >> /dev/null + #ping -c3 -W3 -q $1 >> /dev/null + #timeout 5 bash -c 'echo "ping" > /dev/tcp/$1/80'; echo $? + + nc -z -w3 $1 80 > /dev/null + PSTATUS=$(echo $?) }