Nagios FROM email address

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Nagios FROM email address

Post by MarkCampbell »

This may be a stupid question, but I've been going throughout the UI looking for this and have only seen one field for the Nagios FROM email field, which I've found in nagiosxi/admin/mailsettings.php. I've changed it here to Nagios XI <[email protected]>, and when I tell it to send me a test email, I get it exactly as I typed it in... but when I receive actual alert emails, it comes as [email protected] (this server is in AWS, which defaults the hostname to the IP in dashes). Where else could this alternate email address be set?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios FROM email address

Post by benjaminsmith »

HI Mark,

Thanks for trying out Nagios XI and welcome to the Nagios Customer Support Forum!

For clarification, are you using SMTP or Sendmail in your email settings ( a screenshot would be helpful)?

Regards,
Benjamin
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!
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Re: Nagios FROM email address

Post by MarkCampbell »

I am using SMTP to connect to Amazon SES.
2020-10-01 18_08_16-Administration · Nagios XI.png
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios FROM email address

Post by ssax »

This is likely because those contacts are using the notify-host-by-email/notify-service-by-email commands. You can either do this:

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

Or you can edit the notify-host-by-email/notify-service-by-email commands in Configure > Core Config Manager > Commands and add an option to the mail command to set the From address:

The defaults:

notify-host-by-email:

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 -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
notify-service-by-email:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
To: (for example, adding -S "from=Nagios XI <[email protected]>")

notify-host-by-email:

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 -S "from=Nagios XI <[email protected]>" -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
notify-service-by-email:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -S "from=Nagios XI <[email protected]>" -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Then apply configuration and test.

See here as well:

https://assets.nagios.com/downloads/nag ... ntacts.pdf
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Re: Nagios FROM email address

Post by MarkCampbell »

Thanks that worked, I imported my configuration from a Nagios Core instance, but didn't realize it was overriding the use of the php mailer.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios FROM email address

Post by ssax »

Glad that worked for you! Let us know when we're okay to lock this up and mark it as resolved.

Thank you!
MarkCampbell
Posts: 20
Joined: Tue Oct 16, 2018 4:29 pm

Re: Nagios FROM email address

Post by MarkCampbell »

I think I'm good to mark this as resolved.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios FROM email address

Post by scottwilkerson »

MarkCampbell wrote:I think I'm good to mark this as resolved.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked