Return Address Name

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Return Address Name

Post by JohnFLi »

I changed /etc/postfix/main.cf to reflect the @mydomain.com part of the from address. nice and easy

But how to I change the actual NAME of the email address??

currently the return address is [email protected] but I want it to be [email protected]

Any ideas?

(I am using sendmail)
Everybody is somebody else’s weirdo
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Return Address Name

Post by abrist »

You could check the admin_email:

Code: Select all

grep "admin_" /usr/local/nagios/etc/nagios.cfg
Though I think you are seeing the linux user "nagios" as that is what user sent the email. You should be able to change the sender/return/from address in postfix.
Take a look at the following link, especially the mapping section:
http://semi-legitimate.com/blog/item/ho ... in-postfix

EDIT: If you were using the smtp php mailer in XI (requires that every contact be connected to a user), you could just set the sender in the UI (Admin --> Manage email settings)
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.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: Return Address Name

Post by JohnFLi »

Code: Select all

Take a look at the following link, especially the mapping section:
http://semi-legitimate.com/blog/item/ho ... in-postfix
Didn't work...... When I change teh email settings to use sendmail, it still sends as [email protected], even though the address I have set there is different.
Everybody is somebody else’s weirdo
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Return Address Name

Post by jdalrymple »

Admin --> Manage E-mail settings

Worked for me ... using SMTP though.

I'll test with Sendmail.

--EDIT--

Sendmail worked too.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: Return Address Name

Post by JohnFLi »

good for you, happy to hear that.

But in all honesty, that doesn't help me.

When clicking on the 'test email', it does have the proper return address. The issue is when notifications are sent.
Everybody is somebody else’s weirdo
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Return Address Name

Post by tgriep »

Can you post how your contact is defined in NagiosXI?
Go to the "Core Config Manager" > "Contacts" Click in the Floppy Icon for one of your contacts and post the config here.
Also, it is unclear on whether you are using postfix or sendmail as your email server, which one are you using?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Return Address Name

Post by jdalrymple »

Sorry about that, I used the same test method and achieved the same results, it worked. Like you though when the notification process ran it didn't work as we hope/expect.

The solution is easy enough though.

Configure --> CCM --> Commands --> notify-host-by-email, add the "-r" flag:

Code: Select all

/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 -r [email protected] -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Do the same for notify-service-by-email

Let us know if that doesn't solve it for you.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: Return Address Name

Post by JohnFLi »

Outstanding, that worked!!!


I had seen the -r item before, but the places I've seen that had it at the end, not only did that not work, it actually made the address a CC of the email...


Thank you for your help.

Feel free to lock
Everybody is somebody else’s weirdo
Locked