Xymon Mailing List Archive search

removing <!-- [flags:ordAstLe] > from custom email script

list Usa Ims
Wed, 1 Oct 2014 08:19:03 -0700
Message-Id: <user-7ebb3495c4ad@xymon.invalid>

Hi,

My boss didn't like the subject line of the default email alerts and he asked me to change it.

I found a script online that does it -- so I modified the script and the subject line is doing what is expected but the body of the email is displaying some text that I would like not to be displayed.

How can I remove the " red [965282] red <!-- [flags:ordAstLe] >" or more importantly "<!-- [flags:ordAstLe] >"?

Here is the script: 

#!/bin/bash

SM="/usr/sbin/sendmail"
DATE=`date +%Y%m%d-%H%M%S`
FROM="From: Xymon Server <user-d20034f1156f@xymon.invalid>"
TO="To:user-e1be9155d8fc@xymon.invalid"

     if [ "$RECOVERED" = "1" ]; then
     RECOVERED="(Recovered)"
     else
     RECOVERED=""
     fi

SUBJECT="Subject: D0 BIG BROTHER ALERT - $BBSVCNAME test on $BBHOSTNAME"  


MSG="$FROM\n$TO\n$SUBJECT\n\n\n\n$BBALPHAMSG\n"


echo -e "$MSG" | $SM -t
#####################################################

On a 'conn' test, it is displaying:

xxxxxxx.corp.local:conn red [965282] red <!-- [flags:ordAstLe] --> Wed Oct  1 10:46:24 2014 conn NOT ok 

Service conn on xxxxxxx.corp.local is not OK : Host does not respond to ping


System unreachable for 20 poll periods (5386 seconds)

&red 5.5.5.5 is unreachable

###################################################

Is there anyway to remove that? Thanks in advance.

usaims