Page 1 of 1

E-Mail notification not working

Posted: Fri Feb 12, 2016 7:16 am
by comfone
Hi All
We are using the Nagio XI 5.2.3 CentOs appliance.
I have configured the Mail settings in Nagios XI and when I press "Send a Test Emai" it works.
But when I configure a service to send Emails using the command notify-service-by-email shown below, I does not work.

/usr/bin/printf "%b" "Info: $NOTIFICATIONTYPE$ $SERVICESTATE$ $SERVICEOUTPUT$\nDate/Time: $DATE$ $TIME$\n(Timestamp when the Alarm has left the Nagios system!)\nHost: $HOSTNAME$/$HOSTALIAS$\nService: $SERVICEDESC$\nWiki: $SERVICENOTESURL$\nAlarm sent by NagiosXI" | /bin/mail -r [email protected] -s "$HOSTNAME$: $SERVICESTATE$ $SERVICEDESC$" $CONTACTEMAIL$

Also trying to send Emails using the cmd with the command: "echo 'test1' | mail -r [email protected] -s "TEST1" [email protected]" is not working.

Thank you for your quick help.

Cheers,

Re: E-Mail notification not working

Posted: Fri Feb 12, 2016 10:44 am
by rkennedy
The command you mentioned is for sendmail, but your configuration settings are for SMTP. Try changing the command to xi_service_notification_handler.

Ultimately, how would you like to send mail?

Re: E-Mail notification not working

Posted: Mon Feb 15, 2016 2:28 am
by comfone
I solved the problem.
I had to edit the "relayhost = " entry in the file /etc/postfix/main.cf.
Cheers,