[Nagiosplug-checkins] nagiosplug/plugins check_ping.c,1.49,1.50
Ton Voon
tonvoon at users.sourceforge.net
Mon Mar 13 03:09:04 CET 2006
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14656
Modified Files:
check_ping.c
Log Message:
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
Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- check_ping.c 14 Sep 2005 14:40:20 -0000 1.49
+++ check_ping.c 13 Mar 2006 11:08:28 -0000 1.50
@@ -452,9 +452,22 @@
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);
More information about the Commits
mailing list