Page 1 of 1
Down Time Notification from sender
Posted: Tue Nov 24, 2020 10:38 am
by elealyngarcia
Hi
We are having an issue with the Downtime Sender as @hostname.localdomain, instead of the Mail Settings
Send Mail From:
Screenshot 2020-11-24 233749.png
Screenshot 2020-11-24 233559.png
Re: Down Time Notification from sender
Posted: Wed Nov 25, 2020 11:14 am
by benjaminsmith
Hi,
Try updating the field with just the email address (see screenshot) and then select the
Send a Test Email button to see if the address field was updated correctly (perhaps it's not getting saved to the database).
email-from-address.png
If that's not working, run the following tail command and then repeat the same procedure and post the output. Thanks, Benjamin
Re: Down Time Notification from sender
Posted: Tue Dec 01, 2020 7:35 am
by elealyngarcia
We did configure that Email Setting, but we still have the issue for the Scheduled Downtime notification alert using the @localhost
Re: Down Time Notification from sender
Posted: Wed Dec 02, 2020 1:06 pm
by ssax
This is likely because those contacts are using the notify-host-by-email/notify-service-by-email commands.
Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button and I'll verify that's the case.
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:
/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