[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, upstream, updated. upstream/1.0.6-34-gd3fb2ec

Matthias Flacke matthias.flacke at gmx.de
Wed Aug 24 09:21:54 UTC 2011


The following commit has been merged in the upstream branch:
commit a9943909bab85197ca4716287636d3848168abbd
Author: Matthias Flacke <matthias.flacke at gmx.de>
Date:   Thu Jul 28 07:04:24 2011 +0200

    send_multi: provide STDIN error message when no chunks are read
    
    Errors in the feeding check_multi are hard to find if there is no
    output. And 'WARNING: 0 check_multi child checks submitted' sounds
    like 'something went wrong' ;).
    When no chunks could be read, send_multi now looks for a valid
    ASCIIZ messages in the STDIN input and prints them out. The only
    thing you have to do is to redirect STDERR to STDOUT in your
    command line: check_multi ... 2>&1 | send_multi ...

diff --git a/tools/send_multi.c b/tools/send_multi.c
index b33dc8b..a3f54bf 100644
--- a/tools/send_multi.c
+++ b/tools/send_multi.c
@@ -347,6 +347,19 @@ int read_multi_stream(FILE *stream) {
 
         /* neither <CHILD> nor </CHILD> found, discard buffer */
         } else {
+
+            /* no chunks found? then check for message in STDIN */
+            if (!count) {
+                unsigned long i;
+                /* check buffer for ASCII characters */
+                for (i=0; i<buflen && buffer[i] && isascii(buffer[i]); i++)
+                    ;
+                /* ASCIIZ string? then print messages */
+                if (buffer[i] == '\0' && i) {
+                    printf("send_multi WARNING: error msg in input buffer: %s\n", buffer);
+                }
+            }
+
             /* discard whole buffer but continue */
             buflen=0L;
             gm_log( GM_LOG_TRACE, "Error: no starting tag <CHILD> within buffer - discarding buffer, buflen now %ld bytes\n", buflen);

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list