[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. f5edd3e88aa2138dcf6d044c835fbd0ada944168

Sven Nierlein sven at nierlein.de
Fri Feb 11 11:18:05 UTC 2011


The following commit has been merged in the master branch:
commit 47e540d71d60d3ce676ffc22b7fad1975a19c0a5
Author: Matthias Flacke <Matthias.Flacke at gmx.de>
Date:   Tue Jan 25 22:55:32 2011 +0800

    Added [ stderr ] to send_multi

diff --git a/Changes b/Changes
index 3c9d5ae..f149746 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 This file documents the revision history for mod_gearman.
 
 1.0    Sun...
+          - added stderr to send_multi
           - added missing performance data to send_multi
 
 0.9    Sun Jan 16 21:20:06 CET 2011
diff --git a/tools/send_multi.c b/tools/send_multi.c
index 156816d..d43747f 100644
--- a/tools/send_multi.c
+++ b/tools/send_multi.c
@@ -344,6 +344,7 @@ int read_multi_stream(FILE *stream) {
 int read_child_check(char *bufstart, char *bufend) {
     char *attribute  = NULL;
     char *attribute2 = NULL;
+    char *error = NULL;
     char temp_buffer[GM_BUFFERSIZE];
 
     /* child check number */
@@ -396,11 +397,22 @@ int read_child_check(char *bufstart, char *bufend) {
     /* message */
     if ((attribute=read_multi_attribute(bufstart,bufend,"output")) == NULL)
         return 0;
+
+    /* stderr */
+    if ((error=read_multi_attribute(bufstart,bufend,"error")) == NULL) {
+        return 0;
+    /* if error found: 'error' -> ' [error]' */
+    } else if (*error) {
+        *(--error)='[';
+        *(--error)=' ';
+        strcat(error,"]");
+    }
+
     /* performance data */
     if ((attribute2=read_multi_attribute(bufstart,bufend,"performance")) == NULL) {
-        snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s", decode_xml(attribute));
+        snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s%s", decode_xml(attribute), decode_xml(error));
     } else {
-        snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s|%s", decode_xml(attribute), decode_xml(attribute2));
+        snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s%s|%s", decode_xml(attribute), decode_xml(error), decode_xml(attribute2));
     }
     mod_gm_opt->message=strdup(temp_buffer);
     gm_log( GM_LOG_TRACE, "mod_gm_opt->message: %s\n", mod_gm_opt->message);

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list