diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2014-04-21 11:29:45 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-04-27 19:59:06 +0200 |
commit | e0af39d7e9fcd084cf7d2d8a57d07ab1f8038150 (patch) | |
tree | f6eee031831451476795e139b6ceb33298b1155d /plugins | |
parent | d00efeb872c968824879614c848cead71452cbfd (diff) | |
download | monitoring-plugins-e0af39d7e9fcd084cf7d2d8a57d07ab1f8038150.tar.gz |
Make check_ping work on Windows.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_ping.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 95ac7b44..dbc5c3e4 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -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; } |