Nagios Unable to Send Email After SMTP Migration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
JNelson
Posts: 11
Joined: Fri Oct 02, 2015 10:04 am
Location: Melville, NY

Nagios Unable to Send Email After SMTP Migration

Post by JNelson »

We recently replaced our SMTP server. We're using a virtual host, so the hostname in use did not change, so there should be no settings to update. A wide variety of servers and devices across our global environment experienced no impact or disruption of service, but only Nagios is experiencing an issue.

I get the following when attempting a test email:

"A test email was sent to [email protected]
----
Mailer said: [05-31-2019 11:28:33] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=usmlvrelay.vsp.com;port=25;security=none), Referer: admin/testemail.php
An error occurred sending a test email!"

I am able to send an email manually using telnet from the Nagios server, so there does not appear to be any connectivity issues. I ran RHEL updates and rebooted the server. I'm struggling to find an error more detailed than "SMTP connect() failed". Any advice for how to proceed?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios Unable to Send Email After SMTP Migration

Post by cdienger »

Enable debug logging by following https://support.nagios.com/kb/article/p ... g-820.html and let us know what is returned.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
JNelson
Posts: 11
Joined: Fri Oct 02, 2015 10:04 am
Location: Melville, NY

Re: Nagios Unable to Send Email After SMTP Migration

Post by JNelson »

Thanks for your reply. Here are the results after changing the debug level.

Code: Select all

2019-05-31 17:57:20	Connection: opening to usmlvrelay.vsp.com:25, timeout=300, options=array ( ) 2019-05-31 17:57:20	Connection: opened 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "" 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "220 mailr7.vsp.com Microsoft ESMTP MAIL Service, Version: 10.0.14393.2608 ready at Fri, 31 May 2019 13:57:20 -0400 " 2019-05-31 17:57:20	SERVER -> CLIENT: 220 mailr7.vsp.com Microsoft ESMTP MAIL Service, Version: 10.0.14393.2608 ready at Fri, 31 May 2019 13:57:20 -0400 2019-05-31 17:57:20	CLIENT -> SERVER: EHLO usmlvnagios01.vsp.com 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "" 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-mailr7.vsp.com Hello [10.44.12.104] " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-TURN " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-SIZE 104857600 " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-ETRN " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-PIPELINING " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-DSN " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-8bitmime " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-BINARYMIME " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-CHUNKING " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-VRFY " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-TLS " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250-TLS " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250-STARTTLS " 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250-TLS 250-STARTTLS " 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "250 OK " 2019-05-31 17:57:20	SERVER -> CLIENT: 250-mailr7.vsp.com Hello [10.44.12.104] 250-TURN 250-SIZE 104857600 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250-TLS 250-STARTTLS 250 OK 2019-05-31 17:57:20	CLIENT -> SERVER: STARTTLS 2019-05-31 17:57:20	SMTP -> get_lines(): $data is "" 2019-05-31 17:57:20	SMTP -> get_lines(): $str is "220 2.0.0 SMTP server ready " 2019-05-31 17:57:20	SERVER -> CLIENT: 220 2.0.0 SMTP server ready 2019-05-31 17:57:20	SMTP Error: Could not connect to SMTP host. 2019-05-31 17:57:20	SMTP NOTICE: EOF caught while checking if connected 2019-05-31 17:57:20	Connection: closed 2019-05-31 17:57:20	SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios Unable to Send Email After SMTP Migration

Post by cdienger »

The XI system is trying to do TLS even though "none" is selected for security and the mail server is likely not expecting the STARTTLS command XI is sending. To stop this, edit /usr/local/nagiosxi/html/includes/phpmailer/class.phpmailer.php and change line 260 from:

Code: Select all

public $SMTPAutoTLS = true;
to:

Code: Select all

public $SMTPAutoTLS = false;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
JNelson
Posts: 11
Joined: Fri Oct 02, 2015 10:04 am
Location: Melville, NY

Re: Nagios Unable to Send Email After SMTP Migration

Post by JNelson »

That resolved the issue. Thanks so much for your quick and accurate support!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios Unable to Send Email After SMTP Migration

Post by cdienger »

Glad to hear! I will be filing a bug regarding this. Thanks for bringing it to our attention.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked