mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-15 22:00:06 -04:00
Make check_ping work on Windows.
This commit is contained in:
parent
d00efeb872
commit
e0af39d7e9
2 changed files with 19 additions and 4 deletions
16
configure.ac
16
configure.ac
|
|
@ -90,6 +90,7 @@ ac_cv_uname_m=`uname -m`
|
|||
ac_cv_uname_s=`uname -s`
|
||||
ac_cv_uname_r=`uname -r`
|
||||
ac_cv_uname_v=`uname -v`
|
||||
ac_cv_uname_o=`uname -o`
|
||||
|
||||
PKG_ARCH=`uname -p`
|
||||
REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
|
||||
|
|
@ -1011,6 +1012,13 @@ then
|
|||
ac_cv_ping_packets_first=yes
|
||||
fi
|
||||
|
||||
elif [[ "z$ac_cv_uname_o" = "zCygwin" ]]
|
||||
then
|
||||
with_ping_command="$PATH_TO_PING -n %d -w %d000 %s"
|
||||
ac_cv_ping_packets_first=yes
|
||||
ac_cv_ping_has_timeout=yes
|
||||
AC_MSG_RESULT([$with_ping_command])
|
||||
|
||||
elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
|
||||
$PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
|
||||
egrep -i "^round-trip|^rtt" >/dev/null
|
||||
|
|
@ -1024,7 +1032,7 @@ elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
|
|||
then
|
||||
with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
|
||||
ac_cv_ping_packets_first=yes
|
||||
ac_cv_ping_has_timeout=yes
|
||||
ac_cv_ping_has_timeout=yes
|
||||
AC_MSG_RESULT([$with_ping_command])
|
||||
|
||||
elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
|
||||
|
|
@ -1121,7 +1129,11 @@ then
|
|||
then
|
||||
ac_cv_ping6_packets_first=yes
|
||||
fi
|
||||
|
||||
elif [[ "z$ac_cv_uname_o" = "zCygwin" -a "x$PATH_TO_PING" != "x" ]]; then
|
||||
with_ping6_command="$PATH_TO_PING -6 -n %d -w %d000 %s"
|
||||
ac_cv_ping6_packets_first=yes
|
||||
ac_cv_ping_has_timeout=yes
|
||||
AC_MSG_RESULT([$with_ping6_command])
|
||||
elif test "x$PATH_TO_PING6" != "x"; then
|
||||
if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
|
||||
$PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
|
||||
|
|
|
|||
|
|
@ -458,7 +458,8 @@ run_ping (const char *cmd, const char *addr)
|
|||
(sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) ||
|
||||
(sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) ||
|
||||
(sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
|
||||
(sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match)
|
||||
(sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
|
||||
(sscanf(buf,"%*[^(](%d%% %*[^)])%n",&pl,&match) && match)
|
||||
)
|
||||
continue;
|
||||
|
||||
|
|
@ -471,7 +472,9 @@ run_ping (const char *cmd, const char *addr)
|
|||
(sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
|
||||
(sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
|
||||
(sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
|
||||
(sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match))
|
||||
(sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match) ||
|
||||
(sscanf(buf, "%*[^=] = %*fms, %*[^=] = %*fms, %*[^=] = %fms%n", &rta, &match) && match)
|
||||
)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue