From 455fe96e7dcadd433973b1709ee79cdb58ffe428 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 24 Jan 2014 18:33:37 +0100 Subject: check_ping: Fixing "time of day goes back" by Geoff Oakham 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 --- plugins/check_ping.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/check_ping.c') 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) /* check stderr, setting at least WARNING if there is output here */ /* Add warning into warn_text */ while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) { - if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")) { + if ( + ! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP") + && ! strstr(buf,"Warning: time of day goes back") + + ) { if (verbose >= 3) { printf("Got stderr: %s", buf); } -- cgit v1.2.3