Page 1 of 2

cannot send email

Posted: Tue Nov 28, 2017 10:43 am
by tonkaUser
Hi,

We downloaded Nagios XI (.ova file) and have it up and running. We cannot send email however. I see the below "connection refused messages" in my /var/log/maillog. The mail server configured in Nagios Web UI is smtp.xyz.com, but somehow the log shows connection to xyz.com. See below:

Nov 28 10:35:20 localhost postfix/qmgr[1590]: CFC701347: from=<[email protected]>, size=1034, nrcpt=1 (queue active)
Nov 28 10:35:20 localhost postfix/smtp[6969]: connect to xyz.com[54.209.30.175]:25: Connection refused

Do I need to change /etc/mail/sendmail.mc? Sendmail and sendmail-cf are installed. For the prototype, we don't use auth for snmp server now. Any advice what needs to be changed?

[root@localhost nrdsconfigmanager]# rpm -qa | grep sendmail
sendmail-cf-8.14.4-9.el6_8.1.noarch
sendmail-8.14.4-9.el6_8.1.x86_64


Thanks!

Re: cannot send email

Posted: Tue Nov 28, 2017 11:55 am
by npolovenko
Hello, @tonkaUser. Please navigate to:

Code: Select all

/usr/local/nagios/libexec/ 
and run:

Code: Select all

 ./check_smtp -H smtp.xyz.com -p port_number
Please replace the hostname and the portnumber and attempt to run this check.
Let us know if the connection goes through or not.

Did you also select SMTP as a mailing method instead of a Sendmail?

Re: cannot send email

Posted: Tue Nov 28, 2017 11:59 am
by tonkaUser
The SMTP check is fine. So must be an issue with sendmail. i updated to use SMTP instead of sendmail and it works now.

[root@localhost libexec]# ./check_smtp -H smtp.xyz.local -p 25
SMTP OK - 0.004 sec. response time|time=0.004209s;;;0.000000

Re: cannot send email

Posted: Tue Nov 28, 2017 3:01 pm
by npolovenko
@tonkaUser, Great! Do you have any other questions before I lock this thread as resolved?

Re: cannot send email

Posted: Wed Nov 29, 2017 1:22 pm
by tonkaUser
We have setup alerting for a server. We have a contact which is a distribution list ([email protected]) (under alerting->Contacts). The contact has host/service notification turned On. We also have notify-service-by-email/notify-host-by-email.
A host has two contact under its manage contacts me and the DL. Only I get alerts and DL does not get notifications. We use SMTP configured as mail setting.

I do see errors in /var/log/maillog. Why are alerts not sent to contact TestMonitorAlerts? The contact does not have a corresponding user.

Nov 29 12:55:22 localhost postfix/error[15424]: C3042D91: to=<[email protected]>, relay=none, delay=2162, delays=2162/0.14/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to prcm.com[54.209.30.175]:25: Connection refused)

Thank you

Re: cannot send email

Posted: Wed Nov 29, 2017 3:33 pm
by npolovenko
@tonkaUser, Please go to that contact settings one more time and under Alert settings, modify Service Notification command and Host Notification command from notify-service-by-email/notify-host-by-email to xi_host_notification_handler and xi_service_notification_handler accordingly. So delete the old commands and assign the new ones. Let us know if that worked.

Re: cannot send email

Posted: Wed Nov 29, 2017 4:03 pm
by tonkaUser
Did not work unfortunately. This is how we configured the contact:
contact_details.png
contact2.png

Re: cannot send email

Posted: Wed Nov 29, 2017 5:15 pm
by dwhitfield
When did you download the OVA? There was a packaging error in late Oct/early Nov that caused notifications to fail. The fix is easy. You just run the 5.4.11 upgrade script.

Re: cannot send email

Posted: Wed Nov 29, 2017 5:51 pm
by tonkaUser
What is my ticket number? I can upload it to the link you gave. I am checking with our infosec guys, so they can allow zip file upload. Thanks

Re: cannot send email

Posted: Wed Nov 29, 2017 5:56 pm
by tonkaUser
Btw, we're on 5.4.11:

Nagios XI Version : 5.4.11
localhost.localdomain 2.6.32-696.13.2.el6.x86_64 x86_64
CentOS release 6.9 (Final)
Gnome is not installed