E-Mail notification not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
comfone
Posts: 127
Joined: Fri May 01, 2015 3:28 am

E-Mail notification not working

Post 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,
You do not have the required permissions to view the files attached to this post.
Last edited by comfone on Mon Feb 15, 2016 2:29 am, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: E-Mail notification not working

Post 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?
Former Nagios Employee
comfone
Posts: 127
Joined: Fri May 01, 2015 3:28 am

Re: E-Mail notification not working

Post by comfone »

I solved the problem.
I had to edit the "relayhost = " entry in the file /etc/postfix/main.cf.
Cheers,
Locked