From e0af39d7e9fcd084cf7d2d8a57d07ab1f8038150 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 21 Apr 2014 11:29:45 +0200 Subject: Make check_ping work on Windows. --- plugins/check_ping.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins') 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; } -- cgit v1.2.3