Changing sender of alert emails?
list Ryan Skadberg
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 user-cfef8cc339f2@xymon.invalid. 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
list Paul Root
Shouldn't this be the mail agent not the xymon server? In sendmail, that would be Dj. In postfix, mydomain(?) or myhostname. Paul Root - Senior Engineer Managed Services Systems - CenturyLink 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 user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>. 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 This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
list Paul Root
I guess for postfix it looks like it would be myorigin. Which is either mydomain or myhostname. In your case, you'd want the myhostname.
▸
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Root, Paul
Sent: Tuesday, May 22, 2012 8:38 AM
To: 'Ryan Skadberg'; xymon at xymon.com
Subject: Re: [Xymon] Changing sender of alert emails?
Shouldn't this be the mail agent not the xymon server?
In sendmail, that would be Dj. In postfix, mydomain(?) or myhostname.
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com<mailto: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<mailto: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 user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>. 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
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
list Ryan Skadberg
Ok, I guess I didn't make what I wanted very obvious :) The domain isn't the part I want to change, I want to change the user it's sending as :) So, I would like to have user-cfef8cc339f2@xymon.invalid for the Internal system and user-0867c3b8204f@xymon.invalid for the external system. I guess right now it's just using the user who runs the xymon processes, but was hoping this was something configurable, so I could make the different instances send as different users (so then I could set up replies to go to the correct host) Skadz
▸
On Tue, May 22, 2012 at 10:35 AM, Root, Paul <user-76fdb6883669@xymon.invalid>wrote:
I guess for postfix it looks like it would be myorigin. Which is either mydomain or myhostname. In your case, you’d want the myhostname.**** ** ** Paul Root - Senior Engineer**** Managed Services Systems - CenturyLink**** ** ** ** ** *From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] *On Behalf Of *Root, Paul *Sent:* Tuesday, May 22, 2012 8:38 AM *To:* 'Ryan Skadberg'; xymon at xymon.com *Subject:* Re: [Xymon] Changing sender of alert emails?**** ** ** Shouldn’t this be the mail agent not the xymon server?**** ** ** In sendmail, that would be Dj. In postfix, mydomain(?) or myhostname. **** ** ** ** ** Paul Root - Senior Engineer**** Managed Services Systems - CenturyLink**** ** ** ** **
*From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com<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
user-cfef8cc339f2@xymon.invalid. 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****
** **
** **
This communication is the property of CenturyLink and may contain
confidential or privileged information. Unauthorized use of this
communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.****
This communication is the property of CenturyLink and may contain
confidential or privileged information. Unauthorized use of this
communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
list Paul Root
So change the userid that runs xymon. /etc/passwd and shadow.
▸
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Ryan Skadberg
Sent: Tuesday, May 22, 2012 1:48 PM
To: xymon at xymon.com
Subject: Re: [Xymon] Changing sender of alert emails?
Ok, I guess I didn't make what I wanted very obvious :)
The domain isn't the part I want to change, I want to change the user it's sending as :)
So, I would like to have
user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid> for the Internal system
and
user-0867c3b8204f@xymon.invalid<mailto:user-0867c3b8204f@xymon.invalid> for the external system.
▸
I guess right now it's just using the user who runs the xymon processes, but was hoping this was something configurable, so I could make the different instances send as different users (so then I could set up replies to go to the correct host)
Skadz
On Tue, May 22, 2012 at 10:35 AM, Root, Paul <user-76fdb6883669@xymon.invalid<mailto:user-76fdb6883669@xymon.invalid>> wrote:
I guess for postfix it looks like it would be myorigin. Which is either mydomain or myhostname. In your case, you'd want the myhostname.
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com> [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of Root, Paul
Sent: Tuesday, May 22, 2012 8:38 AM
To: 'Ryan Skadberg'; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Changing sender of alert emails?
Shouldn't this be the mail agent not the xymon server?
In sendmail, that would be Dj. In postfix, mydomain(?) or myhostname.
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com<mailto: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<mailto: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 user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>. 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
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
list Roland Soderstrom
I can't read if the 2 instances are on the same host or different. If they are different just make a mail alias in the external host. For sendmail it is /etc/mail/aliases Xymon user-547ecd524090@xymon.invalid<mailto:user-547ecd524090@xymon.invalid> Then run newaliases If they're on the same host 2 different xymon users should do the trick. - Roland
▸
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Ryan Skadberg
Sent: Wednesday, 23 May 2012 4:48 AM
To: xymon at xymon.com
Subject: Re: [Xymon] Changing sender of alert emails?
Ok, I guess I didn't make what I wanted very obvious :)
The domain isn't the part I want to change, I want to change the user it's sending as :)
So, I would like to have
user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid> for the Internal system
and
user-0867c3b8204f@xymon.invalid<mailto:user-0867c3b8204f@xymon.invalid> for the external system.
I guess right now it's just using the user who runs the xymon processes, but was hoping this was something configurable, so I could make the different instances send as different users (so then I could set up replies to go to the correct host)
Skadz
On Tue, May 22, 2012 at 10:35 AM, Root, Paul <user-76fdb6883669@xymon.invalid<mailto:user-76fdb6883669@xymon.invalid>> wrote:
I guess for postfix it looks like it would be myorigin. Which is either mydomain or myhostname. In your case, you'd want the myhostname.
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com> [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of Root, Paul
Sent: Tuesday, May 22, 2012 8:38 AM
To: 'Ryan Skadberg'; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Changing sender of alert emails?
Shouldn't this be the mail agent not the xymon server?
In sendmail, that would be Dj. In postfix, mydomain(?) or myhostname.
Paul Root - Senior Engineer
Managed Services Systems - CenturyLink
From: xymon-bounces at xymon.com<mailto: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<mailto: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 user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>. 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
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
list Jeremy Laidman
On Wed, May 23, 2012 at 8:34 AM, Roland Soderstrom <
▸
user-0cec9512a49f@xymon.invalid> wrote:
If they are different just make a mail alias in the external host. For sendmail it is /etc/mail/aliases
The aliases file only maps incoming mail (recipient address), not outgoing (sender address). Postfix can do sender address mapping (see "man generic" and the ADDRESS_REWRITING_README), but if it's on the same server then you won't have a way of selecting one instance from another (unless they're running as different users). However there are other ways to achieve what you want. If you're using "nail" as your mail client (mail -V), you can define options such as "from" and "replyto" in .mailrc. Maybe like this: set from=user-32b094e5cf1a@xymon.invalid Or you could change "MAILC" in xymonserver.cfg and add an "-r" parameter, such as: MAILC="mail -r user-32b094e5cf1a@xymon.invalid" J
list John Rothlisberger
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 user-8062d3e05f9a@xymon.invalid 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
XXX.XXX.XXXX 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 user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>. 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