Changing the SMTP address

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Changing the SMTP address

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Changing the SMTP address

Post by lmiltchev »

When you go to Configure->My Account Settings, what do you see in the "Email Address:" field?
Be sure to check out our Knowledgebase for helpful articles and solutions!
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Re: Changing the SMTP address

Post 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$
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Changing the SMTP address

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Changing the SMTP address

Post by Narie »

Name: Nagios Administrator
Email: My emailaddress

Matthew
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Changing the SMTP address

Post 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>
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Changing the SMTP address

Post by Narie »

Both solutions does not work! It's a pitty that something basics as configuring the send from address does not work.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Changing the SMTP address

Post 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>?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Changing the SMTP address

Post by Narie »

no difference, Still send from Root User.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Changing the SMTP address

Post by abrist »

Are these standalone core contacts or XI user contacts?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked