[Xymon] Changing sender of alert emails?

john.r.rothlisberger at accenture.com john.r.rothlisberger at accenture.com
Wed May 23 14:13:18 CEST 2012


I actually do this for every alert - in my case the from addresses are not real email addresses.  There are several reasons why I went this route - one was to change the sender to be the hostname of the server in trouble.  The 2nd and most important to me was to have a full "TO" and "CC" list so that whomever started working on a problem could easily "reply-all" and let everyone know they were working on the problem.

For each alert I run an external script (a portion of it is below) which sets up the email and then calls a perl script which then does the actual sending of the email.  Yes, there are probably better ways to do this.  I have been doing it this way for years and it has worked out extremely well for us.  There is a lot more to the scripts then what I have below but this is the relevant portion.  I have also added the relevant portion of the perl script that does the email farther down.


/bin/echo -E "
* On call person paged: ${PAGED}

Alert Active Since: ${ACTIVE}
(Duration of Alert ${ALERTTIME})

**************************************************************************
Please respond with a \"reply-all\" to this message if you will be taking
corrective action.  It is critical to communicate to others of your
intentions.  Ignoring these alerts is not an option.

You may use the link below to \"acknowledge\" the alert if the alert
is being investigated.  Do not \"acknowledge\" an alert for more than
60 minutes.

http://`hostname`.domain.com/xymon-cgi/bb-ack.sh
Next to the appropriate system alert enter in the blank boxes:
        - Time in minutes to ignore.
        - Brief description.
        - Click send.
**************************************************************************

SCRIPTNAME - $SCRIPTNAME
BBHOSTNAME - $BBHOSTNAME
BBHOSTSVC - $BBHOSTSVC
MACHIP - $MACHIP
BBSVCNAME - $BBSVCNAME
BBALPHAMSG - $BBALPHAMSG

**************************************************************************
If this message does not require any action by support on any occasion
please send an email to xymongod at domain.com so that we
may ignore this message in the future.  By doing so we can reduce Xymon spam
and increase the chance of receiving only useful and pertinent alerts.
**************************************************************************

" >$BBHOME/server/tmp/bb_email.txt.$$
$BBHOME/server/ext/pg/email.pl $$ "Xymon - CRIT $BBHOSTSVC $BBCOLORLEVEL" $BBHOSTNAME $SCRIPTNAME


        use MIME::Lite;
        use Net::SMTP;


        # Create the initial text of the message
        my $mime_msg = MIME::Lite->new(
                From => $fromhost,
                To   => @TO2,
                Cc   => @CC2,
                'Reply-To' => @TO2,
                Subject => $subject,
                Type => 'text/plain',
                Data => $email
        )
        or die "Error creating MIME body: $!\n";

        my $message_body = $mime_msg->body_as_string();

        MIME::Lite->send('smtp', localhost);
        $mime_msg->send() or die "Error sending message: $!\n";

Thanks,
John
_____________________________________________________________________
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
312.693.3136 office
_____________________________________________________________________

From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Ryan Skadberg
Sent: Monday, May 21, 2012 3:52 PM
To: xymon at xymon.com
Subject: [Xymon] Changing sender of alert emails?

Hi Folks -

  I have 2 instances of Xymon running (one internal to my network and one external).  We have decided we want to set up the ability to ack over email.  This is very easily set up (already did it on the internal version), except for one small detail, email from BOTH comes from xymon at mydomain.com<mailto:xymon at mydomain.com>.  This means that replying to this address can only go to one or both.  Both kind of stinks, as it means one system will be getting bad ack's all the time (and then xymond will go yellow).  I'd like to set the email sender on the external instance to something different, but can't seem to find it anywhere in any of the configs.  I looked through alerts.cfg and the man page and nothing stood out to me.

Is this possible?

Thanks!
Skadz


________________________________
Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120523/ab2c8cb5/attachment.html>


More information about the Xymon mailing list