Xymon Mailing List Archive search

Sending email alerts for xymon

list Henrik Størner
Wed, 25 Jul 2012 23:29:44 +0200
Message-Id: <user-865ac4c7cb92@xymon.invalid>

On 25-07-2012 23:19, Raghuv adhepalli wrote:
Hello,

I am trying to use the xymon alert system to send emails.

When I use "MAIL", I am able to receive the mails as they were intended.
HOST=* SERVICE=* COLOR=yellow
         MAIL user-342b4930477d@xymon.invalid

But, the problem occurs when I start using the "SCRIPT". The mails
aren't being forwarded

HOST=* SERVICE=* COLOR=yellow
         SCRIPT test.sh user-342b4930477d@xymon.invalid

I understand that the "SCRIPT" uses two arguments, the script name and
the recipient name.

Here's how my script looks like,

*****************************************************************
#!bin/bash

mail -s "$BBALPHAMSG $BBHOSTNAME $MACHIP $BBSVCNAME $RECOVERED" $RCPT

*****************************************************************
I don't really understand why you are not using MAIL in alerts.cfg then.
Can anyone please explain to me a bit more on how the alert system works
when the "SCRIPT" is used?
Check the alert.log logfile, it should log whatever error-message the 
alert-script generates (if any). I suspect that your "mail" utility 
drops messages with no message body.

So I wouldn't put $BBALPHAMSG in the subject of a mail. Better to put it 
into the mail body, e.g.

echo "$BBALPHSMSG" | mail -s "$BBHOSTNAME $MACHIP $BBSVCNAME $RECOVERED" 
$RCPT


Regards,
Henrik