Page 3 of 8

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 2:25 pm
by ecolgroveMOT
phpmailer.log shows this:
[10-23-2019 13:57:07] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
[10-23-2019 14:07:05] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
[10-23-2019 14:12:06] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
[10-23-2019 14:12:06] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
[10-23-2019 14:12:06] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
[root@nagiosxi tmp]#

and

tail -f /usr/local/nagiosxi/var/cmdsubsys.log /usr/local/nagiosxi/var/eventman.log shows
[root@nagiosxi tmp]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log /usr/local/nagiosxi/var/eventman.log
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
PROCESSED 0 COMMANDS
....................................................
PROCESSED 0 COMMANDS
..............................................................
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
.........................................................
PROCESSED 0 COMMANDS
...........................
==> /usr/local/nagiosxi/var/eventman.log <==
PROCESSED 0 EVENTS
...................
PROCESSED 0 EVENTS
....................
PROCESSED 0 EVENTS
...................
PROCESSED 0 EVENTS
....................
PROCESSED 0 EVENTS
.........
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
.
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==

PROCESSED 0 EVENTS

==> /usr/local/nagiosxi/var/cmdsubsys.log <==

PROCESSED 0 COMMANDS
.
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
..
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
..
==> /usr/local/nagiosxi/var/eventman.log <==
.
==> /usr/local/nagiosxi/var/cmdsubsys.log <==
...
==> /usr/local/nagiosxi/var/eventman.log <==

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 3:13 pm
by mbellerue
Let's see if we can at least change the error message. Can you just type in a wrong password for that email account, and try to send again? Then we'll just check the phpmailer.log file, since the other two weren't giving anything else.

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 3:21 pm
by ecolgroveMOT
Nagios says:
A test email was sent to [email protected]
----
Mailer said: [10-23-2019 15:19:11] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 3:43 pm
by mbellerue
Alright, run these two commands,

Code: Select all

cd /usr/local/nagiosxi/html/includes/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 4;/g' class.phpmailer.php
And then try to send the test email once more. This time you should get an error message in the web interface itself. Once you get that error message, you can undo the above change by running these two commands,

Code: Select all

cd /usr/local/nagiosxi/html/includes/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 0;/g' class.phpmailer.php

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 3:51 pm
by ecolgroveMOT
First command gives us the web interface error as you instructed and as follows:
2019-10-23 20:48:00 Connection: opening to smtp.office365.com:587, timeout=300, options=array ()
2019-10-23 20:48:00 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.office365.com:587 (Network is unreachable) [/usr/local/nagiosxi/html/includes/phpmailer/class.smtp.php line 299]
2019-10-23 20:48:00 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting
Notice: This trial copy of Nagios XI will expire in 2 days. Purchase a License Now or Enter your license key.
Test Email Settings

Once second command is ran nagios replys with :
A test email was sent to [email protected]
----
Mailer said: [10-23-2019 15:48:00] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!
Use this to send a test email to your current logged in user address to verify you can recieve alerts from Nagios XI.

An email will be sent to: [email protected]

A test email was sent to [email protected]
----
Mailer said: [10-23-2019 15:50:05] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!
Use this to send a test email to your current logged in user address to verify you can recieve alerts from Nagios XI.

An email will be sent to: [email protected]

Change your email address

Re: Text Verification Times Out

Posted: Wed Oct 23, 2019 4:20 pm
by mbellerue
2019-10-23 20:48:00 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.office365.com:587 (Network is unreachable) [/usr/local/nagiosxi/html/includes/phpmailer/class.smtp.php line 299]
2019-10-23 20:48:00 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
That's very strange.

Okay, for your SMTP server, let's just give it an IP address rather than using smtp.office365.com, just to rule out DNS issues. Let's give it, 52.96.70.242 and see what it does.

Re: Text Verification Times Out

Posted: Thu Oct 24, 2019 8:14 am
by ecolgroveMOT
nagios replys with:
A test email was sent to [email protected]
----
Mailer said: [10-24-2019 08:13:31] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=52.96.70.242 ;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!

Re: Text Verification Times Out

Posted: Thu Oct 24, 2019 8:59 am
by ecolgroveMOT
And now when i switch back to sendmail so we can get alerts for the time being. We do not get any alerts anymore. It shows successful just no message. So those last commands must have done something.

Re: Text Verification Times Out

Posted: Thu Oct 24, 2019 11:21 am
by mbellerue
Notice: This trial copy of Nagios XI will expire in 2 days. Purchase a License Now or Enter your license key.
Oh, I didn't catch this. Is your trial still active? When the trial expires, no notifications go out.

Re: Text Verification Times Out

Posted: Thu Oct 24, 2019 11:33 am
by ecolgroveMOT
it says we have 2 days left on the trial