[Xymon] Xymon notifcations disappear due to base64 encoding

Mark Felder feld at feld.me
Fri Feb 6 16:21:18 CET 2015



On Thu, Feb 5, 2015, at 10:23, Ribeiro, Glauber wrote:
> More details:
> 
> In xymonserver.cfg, I have
> 
> #MAILC="mail"   
> MAILC="/usr/local/hobbit/server/mail_nocr.sh"    # Command used to send
> an e-mail with no subject
> MAIL="$MAILC -s"                                # Command used to send an
> e-mail with a subject
> 
> The mail_nocr.sh script is like this:
> 
> #! /bin/bash
> # 20130104 - glauber - get rid of CR in emails
> exec /usr/bin/tr -d '\015' | /bin/mail "$@"
> 
> 

Let's kill this in the code instead of resorting to hacks like this.

One or multiple of these instances of \r is bound to be the cause:

~/svn/xymon-code/xymond > grep '\\r' *
xymond.c:       if (sourcename) cause = strtok(NULL, "\r\n");
xymond.c:                       txtstart += strspn(txtstart, " \t\r\n");
xymond.c:       tok = strtok(buf, " \t\r\n");
xymond.c:       if (tok) tok = strtok(NULL, " \t\r\n");
xymond.c:               tok = strtok(NULL, " \t\r\n");
xymond.c:               ehost = bhost + strcspn(bhost, " \t\r\n");
xymond.c:                       bid = msg->buf + strcspn(msg->buf, "
\t\r\n"); bid += strspn(bid, " \t");
xymond.c:                       eid = bid + strcspn(bid, " \t\r\n");
xymond.c:               p = strtok(p, " \t\r\n");
xymond.c:               p = strtok(p, " \t\r\n");
xymond.c:               p = msg->buf + strcspn(msg->buf, "\r\n");
xymond.c:               if ((*p == '\r') || (*p == '\n')) {
xymond_channel.c:               hostname = inbuf + strcspn(inbuf,
"/|\r\n");
xymond_channel.c:                       hostend = hostname +
strcspn(hostname, "|\r\n");
xymond_client.c:        p = s + strcspn(s, "\r\n");
xymond_locator.c:       const char *delims = "|\r\n\t ";


JC, Henrik -- any ideas?



More information about the Xymon mailing list