diff options
author | Jan Wagner <waja@cyconet.org> | 2014-01-24 18:33:37 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-01-24 18:33:37 +0100 |
commit | 455fe96e7dcadd433973b1709ee79cdb58ffe428 (patch) | |
tree | e062cf64150e98d8ec6eb42a3fabfb57c1c587d8 /plugins/check_ping.c | |
parent | ccecba33a2b32e607b2d008a69a90f6532926374 (diff) | |
download | monitoring-plugins-455fe96e7dcadd433973b1709ee79cdb58ffe428.tar.gz |
check_ping: Fixing "time of day goes back"
by Geoff Oakham <goakham at oanda.com>
Patch of check_ping that allows it to gracefully handle when ping outputs
to stderr "Warning: time of day goes back (-XXXXus), taking countermeasures."
Closes: #809 and #1195
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r-- | plugins/check_ping.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index c0bb32f3..95ac7b44 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -482,7 +482,11 @@ run_ping (const char *cmd, const char *addr) | |||
482 | /* check stderr, setting at least WARNING if there is output here */ | 482 | /* check stderr, setting at least WARNING if there is output here */ |
483 | /* Add warning into warn_text */ | 483 | /* Add warning into warn_text */ |
484 | while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) { | 484 | while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) { |
485 | if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")) { | 485 | if ( |
486 | ! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP") | ||
487 | && ! strstr(buf,"Warning: time of day goes back") | ||
488 | |||
489 | ) { | ||
486 | if (verbose >= 3) { | 490 | if (verbose >= 3) { |
487 | printf("Got stderr: %s", buf); | 491 | printf("Got stderr: %s", buf); |
488 | } | 492 | } |