Page 1 of 2
Changing the SMTP address
Posted: Fri Jan 31, 2014 6:27 am
by Narie
Hi,
I changed the setting Admin/Manage email settings/Send mail from to a new name but I still receive email from Root user <root@localhost>.
Where do I change this setting?
Matthew
Re: Changing the SMTP address
Posted: Fri Jan 31, 2014 12:04 pm
by lmiltchev
When you go to Configure->My Account Settings, what do you see in the "Email Address:" field?
Re: Changing the SMTP address
Posted: Mon Feb 03, 2014 9:14 am
by belvdr
I saw the same effect. I had to modify the notify commands to put the correct address in there. Example for notify-host-by-email:
Code: Select all
/usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\n$NOTIFICATIONAUTHOR$ - $NOTIFICATIONCOMMENT$" | /bin/mail -r <from_email_address> -s "$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$
Re: Changing the SMTP address
Posted: Mon Feb 03, 2014 11:00 am
by abrist
Just a note. belvdr's method will only work with core contacts using the notification commands notify-host-by-email and notify-service-by-email. If you are experiencing this with nagios XI users using the XI notification commands, then you may need to set the return/from email address in admin -- > manage email settings --> send mail from.
Re: Changing the SMTP address
Posted: Tue Feb 11, 2014 10:05 am
by Narie
Name: Nagios Administrator
Email: My emailaddress
Matthew
Re: Changing the SMTP address
Posted: Tue Feb 11, 2014 11:38 am
by lmiltchev
Are notifications sent to Nagios XI users or contacts only? Read about differences here:
http://assets.nagios.com/downloads/nagi ... ntacts.pdf
If these are Nagios XI users, the first method should work (Configure->My Account Settings). If these are contacts only, you may try the belvdr's suggestion. This should work if you use mailx. If you use sendmail, you may try adding the "-f" flag at the end of your command, for example:
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -f <your from address>
Re: Changing the SMTP address
Posted: Thu Feb 20, 2014 8:58 am
by Narie
Both solutions does not work! It's a pitty that something basics as configuring the send from address does not work.
Re: Changing the SMTP address
Posted: Thu Feb 20, 2014 12:03 pm
by lmiltchev
What happens if you switch from using Sendmail to SMTP (Admin->Manage Email Settings->General Mail Settings)? Are you still receiving emails from <root@localhost>?
Re: Changing the SMTP address
Posted: Mon Feb 24, 2014 6:40 am
by Narie
no difference, Still send from Root User.
Re: Changing the SMTP address
Posted: Mon Feb 24, 2014 10:45 am
by abrist
Are these standalone core contacts or XI user contacts?