Change From email address in NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
niaccarino
Posts: 2
Joined: Sun Jul 15, 2018 10:28 pm

Change From email address in NagiosXI

Post by niaccarino »

Hi there,

I am just wondering how I can change the default "from:" email address in Nagios XI?

In the General Email Settings, I have configured to "Send Mail from:" the email address I want to send from, however the emails I receive are still from [email protected].

I have tested changing the nagios.cfg and adding the correct Admin Email address, and also updated the commands.cfg to send from $ADMIN$ which then works, however, there surely must be a way to do it once and for all in the GUI given this is a paid product?

Any help would be much appreciated!

Thanks,
Nino
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Change From email address in NagiosXI

Post by benjaminsmith »

Hi @Nino,

Did use <> brackets in the general mail settings? They are required, and the mail program may use the system default if they are left out.

Plain Text Name <[email protected]>


Please let me know.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Change From email address in NagiosXI

Post by lmiltchev »

When you create xi users, who are also contacts in Nagios XI, then they would be using the xi_host_notification_handler and xi_service_notification_handler commands, and php mailer. In this case, setting the "from address" would work just fine (Admin > System Config > Manage Email Settings > Send Mail From > <your "from" email address>).

However, if your contacts are "contacts only" (not xi users), then they will be using the notify-host-by-email and notify-service-by-email commands, and sendmail/postfix. In this case, setting the "from address" under the "Mail Settings" page won't work. You could still modify your commands from the GUI, and add the "from address" though.

For example, I am using mailx, so I added my "from" address to the notification handlers, using the "-r" flag.

Example:

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$ 
You could also configure your core contacts to use the Nagios XI php mailer settings. Please, review our documentation on the topic here:

https://assets.nagios.com/downloads/nag ... Mailer.pdf

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
niaccarino
Posts: 2
Joined: Sun Jul 15, 2018 10:28 pm

Re: Change From email address in NagiosXI

Post by niaccarino »

Thanks very much for your reply. I ended up changing the notify commands to include the from email address.

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

Re: Change From email address in NagiosXI

Post by lmiltchev »

I am glad I could help! I will be closing this topic now. If you have any further questions, please start a new thread. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked