aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-03-13 11:08:28 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-03-13 11:08:28 +0000
commit5c0aa37260519e37feac734d52c1b9b63090d77f (patch)
tree651de835bfdee1acaee01ccc1670164eb1ff936d
parente340b0db7378741bd956409c7f1cda599f159a11 (diff)
downloadmonitoring-plugins-5c0aa37260519e37feac734d52c1b9b63090d77f.tar.gz
Change warning message if there is stderr output. This catches a problem
where time was shifting backwards on a linux VMware guest during the ping git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1322 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_ping.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 1903678d..a7b7d902 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -452,9 +452,22 @@ run_ping (const char *cmd, const char *addr)
rta = crta;
/* check stderr, setting at least WARNING if there is output here */
- while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr))
- if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP"))
- result = max_state (STATE_WARNING, error_scan (buf, addr));
+ /* 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 (verbose >= 3) {
+ printf("Got stderr: %s", buf);
+ }
+ if ((result=error_scan(buf, addr)) == STATE_OK) {
+ result = STATE_WARNING;
+ if (warn_text == NULL) {
+ warn_text = strdup(_("System call sent warnings to stderr "));
+ } else {
+ asprintf(&warn_text, "%s %s", warn_text, _("System call sent warnings to stderr "));
+ }
+ }
+ }
+ }
(void) fclose (child_stderr);