summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-09-12 11:51:48 +0000
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-09-12 11:51:48 +0000
commit37fc36aba8d107facbd8e02df1f1138ed14efa10 (patch)
tree1a934508f657d04237868031a175bf040ec797e9 /plugins
parent76ba1310211f9f28a8f34a5e5cd1029d56210ca1 (diff)
downloadmonitoring-plugins-37fc36aba8d107facbd8e02df1f1138ed14efa10.tar.gz
*new output format reported by Patrick Allen <p.allen@brandblue.co.uk>, also move atrribution for Richard Brodie to thanks file
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/release-1.3.0@720 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_ping.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 0c0f2e44..342a89ef 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -383,41 +383,22 @@ run_ping (char *command_line)
383 } 383 }
384 384
385 /* get the percent loss statistics */ 385 /* get the percent loss statistics */
386 if (sscanf 386 if (sscanf(input_buffer,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
387 (input_buffer, "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss", 387 sscanf(input_buffer,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
388 &pl) == 1 388 sscanf(input_buffer,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
389 || sscanf 389 sscanf(input_buffer,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss",&pl)==1 ||
390 (input_buffer, "%*d packets transmitted, %*d packets received, %d%% packet loss", 390 sscanf(input_buffer,"%*d packets transmitted, %*d received, %d%% loss, time",&pl)==1)
391 &pl) == 1
392 || sscanf
393 (input_buffer, "%*d packets transmitted, %*d packets received, %d%% loss, time", &pl) == 1
394 || sscanf
395 (input_buffer, "%*d packets transmitted, %*d received, %d%% loss, time", &pl) == 1
396 /* Suse 8.0 as reported by Richard * Brodie */
397 )
398 continue; 391 continue;
399 392
400 /* get the round trip average */ 393 /* get the round trip average */
401 else 394 else
402 if (sscanf (input_buffer, "round-trip min/avg/max = %*f/%f/%*f", &rta) 395 if (sscanf(input_buffer,"round-trip min/avg/max = %*f/%f/%*f",&rta)==1 ||
403 == 1 396 sscanf(input_buffer,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f",&rta)==1 ||
404 || sscanf (input_buffer, 397 sscanf(input_buffer,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f",&rta)==1 ||
405 "round-trip min/avg/max/mdev = %*f/%f/%*f/%*f", 398 sscanf(input_buffer,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
406 &rta) == 1 399 sscanf(input_buffer,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",&rta)==1 ||
407 || sscanf (input_buffer, 400 sscanf(input_buffer,"round-trip (ms) min/avg/max = %*f/%f/%*f",&rta)==1 ||
408 "round-trip min/avg/max/sdev = %*f/%f/%*f/%*f", 401 sscanf(input_buffer,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",&rta)==1)
409 &rta) == 1
410 || sscanf (input_buffer,
411 "round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",
412 &rta) == 1
413 || sscanf (input_buffer,
414 "round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",
415 &rta) == 1
416 || sscanf (input_buffer, "round-trip (ms) min/avg/max = %*f/%f/%*f",
417 &rta) == 1
418 || sscanf (input_buffer, "rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",
419 &rta) == 1
420 )
421 continue; 402 continue;
422 } 403 }
423 404