diff options
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r-- | plugins/check_ping.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index eef2195b..dbc5c3e4 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | * | 2 | * |
3 | * Nagios check_ping plugin | 3 | * Monitoring check_ping plugin |
4 | * | 4 | * |
5 | * License: GPL | 5 | * License: GPL |
6 | * Copyright (c) 2000-2007 Nagios Plugins Development Team | 6 | * Copyright (c) 2000-2007 Monitoring Plugins Development Team |
7 | * | 7 | * |
8 | * Description: | 8 | * Description: |
9 | * | 9 | * |
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | const char *progname = "check_ping"; | 31 | const char *progname = "check_ping"; |
32 | const char *copyright = "2000-2007"; | 32 | const char *copyright = "2000-2007"; |
33 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 33 | const char *email = "devel@monitoring-plugins.org"; |
34 | 34 | ||
35 | #include "common.h" | 35 | #include "common.h" |
36 | #include "netutils.h" | 36 | #include "netutils.h" |
@@ -458,7 +458,8 @@ run_ping (const char *cmd, const char *addr) | |||
458 | (sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) || | 458 | (sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) || |
459 | (sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) || | 459 | (sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) || |
460 | (sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) || | 460 | (sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) || |
461 | (sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) | 461 | (sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) || |
462 | (sscanf(buf,"%*[^(](%d%% %*[^)])%n",&pl,&match) && match) | ||
462 | ) | 463 | ) |
463 | continue; | 464 | continue; |
464 | 465 | ||
@@ -471,7 +472,9 @@ run_ping (const char *cmd, const char *addr) | |||
471 | (sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) || | 472 | (sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) || |
472 | (sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) || | 473 | (sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) || |
473 | (sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) || | 474 | (sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) || |
474 | (sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match)) | 475 | (sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match) || |
476 | (sscanf(buf, "%*[^=] = %*fms, %*[^=] = %*fms, %*[^=] = %fms%n", &rta, &match) && match) | ||
477 | ) | ||
475 | continue; | 478 | continue; |
476 | } | 479 | } |
477 | 480 | ||
@@ -482,7 +485,11 @@ run_ping (const char *cmd, const char *addr) | |||
482 | /* check stderr, setting at least WARNING if there is output here */ | 485 | /* check stderr, setting at least WARNING if there is output here */ |
483 | /* Add warning into warn_text */ | 486 | /* Add warning into warn_text */ |
484 | while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) { | 487 | while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) { |
485 | if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")) { | 488 | if ( |
489 | ! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP") | ||
490 | && ! strstr(buf,"Warning: time of day goes back") | ||
491 | |||
492 | ) { | ||
486 | if (verbose >= 3) { | 493 | if (verbose >= 3) { |
487 | printf("Got stderr: %s", buf); | 494 | printf("Got stderr: %s", buf); |
488 | } | 495 | } |
@@ -581,7 +588,7 @@ print_help (void) | |||
581 | printf (" %s\n", "-L, --link"); | 588 | printf (" %s\n", "-L, --link"); |
582 | printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)")); | 589 | printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)")); |
583 | 590 | ||
584 | printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 591 | printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
585 | 592 | ||
586 | printf ("\n"); | 593 | printf ("\n"); |
587 | printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel")); | 594 | printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel")); |