Page 1 of 2

Notification not Going through

Posted: Fri Mar 16, 2018 9:28 am
by rtsupport
HI Team,

we are planning to upgrade from Nagios XI 2014R2.7 - 5.4.12 and in order to test before migrate PRD server we have updated Dev Environment to latest Version Nagios XI 5.4.12.

As earlier in Dev Environment notification was not enabled so we are planning to first test it in on DEV before move to PRD. as of now we have upgraded it to Latest version but now stuck on Notification.

Error ----

when i am sending test Mail from Nagios Portal i am getting below error ...

A test email was sent to *******[email protected]
----
Mailer said: [03-16-2018 09:43:35] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=forwarder.mail.xerox.com;port=25;smtpauth=true;security=none), Referer: admin/testemail.php
An error occurred sending a test email!

Have refereed below URL as well.

https://support.nagios.com/kb/article.php?id=36
https://support.nagios.com/kb/article.php?id=136

Below are few points which you might be require for further go on...

Current Environment -- Nagios XI 5.4.12
OS -- Linux 2.6.32-431.20.5.el6.x86_64
Contact Template -- xi_host_notification_handler
Notification sent -- 24*7
Notification Settings Management -- Using Default Template
Mail Method -- SMTP
Able to Telnet -- Yes with 25 Port
Notification Enabled -- Yes
Able to Send Mail from Linux Terminal -- Yes
Checked with Exchange team Nagios XI is allowed to send Mail -- Yes

Under Incident Management > Notification > I am able to see Nagios is sending Alert to My E-Mail ID.

Command --
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"



tail /usr/local/nagiosxi/tmp/phpmailer.log

[03-16-2018 10:10:08] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=forwarder.mail.xerox.com;port=25;smtpauth=true;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[03-16-2018 10:10:38] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=forwarder.mail.xerox.com;port=25;smtpauth=true;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[03-16-2018 10:12:31] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=forwarder.mail.xerox.com;port=25;smtpauth=true;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email

Re: Notification not Going through

Posted: Fri Mar 16, 2018 11:50 am
by scottwilkerson
you need to make sure your XI server can resolve forwarder.mail.xerox.com and that you have the correct port and security setting for this host,
and is allowed to send mail through forwarder.mail.xerox.com

This is the error you are getting:
https://github.com/PHPMailer/PHPMailer/ ... -smtp-host

Re: Notification not Going through

Posted: Mon Mar 19, 2018 9:16 am
by rtsupport
we have verified with Exchange team and as per them forwarder.mail.xerox.com is allowed to send mail.

able to telnet as well ---

[nagios@**** ~]$ telnet forwarder.mail.xerox.com 25
Trying *****...
Connected to forwarder.mail.xerox.com.
Escape character is '^]'.
220 ****.mail.xerox.com ESMTP


Let me know if is there any other way through which we can verify as we are all set on this part.

Re: Notification not Going through

Posted: Mon Mar 19, 2018 3:03 pm
by tgriep
Login to the XI GUI and go to the Admin > Manage Email Settings menu, verify that the Mail Method is set to SMTP and that the SMTP Settings are correct.

Lets run a tcpdump to see the Nagios server connecting to the

Run this command as root on the Nagios server.

Code: Select all

tcpdump -i any -s 65535 -w smtp.cap host forwarder.mail.xerox.com
Then try and send a test email from the XI GUI to generate some traffic.

Stop the tcpdump and post the smtp.cap file so we can decode the traffic.

If you do not have tcpdump in the server, run the following to install it.

Code: Select all

yum install tcpdump -y

Re: Notification not Going through

Posted: Tue Mar 20, 2018 8:33 am
by rtsupport
Have verified SMTP configuration in Mail Setting ( Attached screen shot for your reference )

Also smtp.cap file sent to your PM.

Re: Notification not Going through

Posted: Tue Mar 20, 2018 12:00 pm
by tgriep
Thanks for the capture file.
I took a look at the capture file and it looks like your SMTP server is requesting STARTTLS for the Security settings so try changing that in the Manage Email Settings menu and see if it works.

The old PHPMailer that was included in the older version of XI may have had a bug and that is why it was working before.
The newer version of XI requires the settings to match what the SMTP server is requesting.

Re: Notification not Going through

Posted: Wed Mar 21, 2018 9:45 am
by rtsupport
Have tried to with TLS and SSL with Port -25 in Mail setting but that is also not worked.

Also as per Exchange team confirmation they are using only Port 25 for SMTP communication.

and can you advise how we can check and verify our SMTP server is requesting for STARTTLS so that on behalf of that we can work with Exchange accordingly..

Please advise other suggestion as well on which we can go..

Re: Notification not Going through

Posted: Wed Mar 21, 2018 12:37 pm
by tgriep
In the tcpdump capture file, after the Nagios server connects to the SMTP server, The SMPT responds with the following requesting that TLS be used.

Code: Select all

8	0.531840	Source IP	Destination IP	SMTP	148	S: 250 usaxxxxxxxx.mail.xerox.com | 250 8BITMIME | 250 SIZE 41943040 | 250 STARTTLS
Try removing the user name and password from that screen and test again to see if it works.

Re: Notification not Going through

Posted: Tue Mar 27, 2018 12:37 pm
by rtsupport
@ tgrip,

Thank You! your suggestion for removing password works for us and now we are receiving alerts.

Could you also please advised for the things we have to remind during Up-gradation process. as while looking documentation i am not able to found single document which cover all the things end to end upgrade e.g Nagios, NRPE, DB, or May be other things which we can keep up-to date.

- Any document for pre and Post checklist for Nagios upgrade.
- what things we can check to be sure we are good to go to PRD environments.

Re: Notification not Going through

Posted: Tue Mar 27, 2018 3:14 pm
by scottwilkerson
rtsupport wrote:- Any document for pre and Post checklist for Nagios upgrade.
- what things we can check to be sure we are good to go to PRD environments
For the most part everything that needs to be update is automatically when you upgrade to the latest versions of XI.

Sometime if there becomes a feature you need in a newer version of an agent (NRPE or NCPA) you may want to upgrade them on remote machines but usually it is not required and we try to make items backwards compatible.