Ver código fonte

check_ping runs 30 times when host is down

Fix for issue #139

`-w` (lower-case) was being used, and it should have been
`-W` (upper-case). `-w` does not stop after `-c` count packets
have been sent, it's just a timeout. `-W` stops sending after
`-c` packets, but waits the timeout time before quitting.
John C. Frickson 9 anos atrás
pai
commit
b7ee01a257
2 arquivos alterados com 5 adições e 4 exclusões
  1. 1 0
      NEWS
  2. 4 4
      configure.ac

+ 1 - 0
NEWS

@@ -4,6 +4,7 @@ This file documents the major additions and syntax changes between releases.
 	FIXES
 	FIXES
 	check_http: -e breaks -f
 	check_http: -e breaks -f
 	check_mrtg: Add state to status output
 	check_mrtg: Add state to status output
+	check_ping: ping runs 30 times when host is down
 
 
 
 
 2.1.4 2016-11-17
 2.1.4 2016-11-17

+ 4 - 4
configure.ac

@@ -1098,10 +1098,10 @@ then
 	ac_cv_ping_packets_first=yes
 	ac_cv_ping_packets_first=yes
 	AC_MSG_RESULT([$with_ping_command])
 	AC_MSG_RESULT([$with_ping_command])
 
 
-elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
+elif $PATH_TO_PING -n -U -W 10 -c 1 127.0.0.1 2>/dev/null | \
 	egrep -i "^round-trip|^rtt" >/dev/null
 	egrep -i "^round-trip|^rtt" >/dev/null
 then
 then
-	with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
+	with_ping_command="$PATH_TO_PING -n -U -W %d -c %d %s"
 	ac_cv_ping_packets_first=yes
 	ac_cv_ping_packets_first=yes
 	ac_cv_ping_has_timeout=yes
 	ac_cv_ping_has_timeout=yes
 	AC_MSG_RESULT([$with_ping_command])
 	AC_MSG_RESULT([$with_ping_command])
@@ -1214,10 +1214,10 @@ elif test "x$PATH_TO_PING6" != "x"; then
 		ac_cv_ping6_packets_first=yes
 		ac_cv_ping6_packets_first=yes
 		AC_MSG_RESULT([$with_ping6_command])
 		AC_MSG_RESULT([$with_ping6_command])
 
 
-	elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
+	elif $PATH_TO_PING6 -n -U -W 10 -c 1 ::1 2>/dev/null | \
 		egrep -i "^round-trip|^rtt" >/dev/null
 		egrep -i "^round-trip|^rtt" >/dev/null
 	then
 	then
-		with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
+		with_ping6_command="$PATH_TO_PING6 -n -U -W %d -c %d %s"
 		ac_cv_ping6_packets_first=yes
 		ac_cv_ping6_packets_first=yes
 		ac_cv_ping_has_timeout=yes
 		ac_cv_ping_has_timeout=yes
 		AC_MSG_RESULT([$with_ping6_command])
 		AC_MSG_RESULT([$with_ping6_command])