Page 1 of 1

NagiosXI fail send outbound emails to external mailbox

Posted: Mon Mar 02, 2020 10:47 am
by imadc
Hello Team

We have NagiosXI version 5.6.12

That is configured to send email to VictorOps top page the team

It is failing to send emails to victorops.com while it is succeeding for other internal email domain

Here is an example of the length of the email addresses from victorops :
b31e0dSS-dc76-4XXX-xx3e-7ca99f1f77da+OpsGroupSupport@alert.victorops.com

Thanks
Imad

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Mon Mar 02, 2020 11:53 am
by jdunitz
Are you using sendmail or PHP mailer?

Could you post a screenshot of Admin->SystemConfig (on the left)->Email Settings?

Are you seeing anything helpful in /var/log/maillog?

Also, you may find this document helpful if you're using PHP mailer (SMTP Server):

PHPMailer - Troubleshooting Using Debug Logging

Let us know what you find, and we'll go from there.


--Jeffrey

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Mon Mar 02, 2020 3:18 pm
by imadc
Hello Jeffrey

Are you using sendmail or PHP mailer?
We are using SMTP Send Method using our internal relay.
As part of investigation we used the same target addresses and same relay and it is working with other sytems or through powershell script but not through NagiosXI.

Could you post a screenshot of Admin->SystemConfig (on the left)->Email Settings?
Attached the screenshot

Are you seeing anything helpful in /var/log/maillog?
I attached the latest mail log

Thanks
Imad

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Mon Mar 02, 2020 4:31 pm
by jdunitz
Hello @imadc,

Now that the logging for PHPmailer has been enabled, please post that log as well. You'll find it in the following directory.

Code: Select all

/usr/local/nagiosxi/tmp/phpmailer.log
Because we're seeing things like this in your logs...

Code: Select all

Feb 23 03:45:30 prodnagios postfix/smtp[31155]: connect to mxb.mailgun.org[34.218.165.121]:25: Connection timed out
Feb 23 03:56:00 prodnagios postfix/smtp[8961]: connect to mx.sendgrid.net[167.89.123.50]:25: Connection timed out
...that makes me wonder if those SMTP hosts are blocking you or not reachable for some reason.

Can you try testing them from your XI machine by telnetting to port 25 or using nmap and see what you can find out?

Code: Select all

[root@jpd-nagiosxi-two snmptt]# telnet 34.218.165.121 25
Trying 34.218.165.121...
Connected to 34.218.165.121.
Escape character is '^]'.
220 ****************
or

Code: Select all

[root@jpd-nagiosxi-two snmptt]# nmap -v  34.218.165.121 -p 25
...and look for "open" in the output, to see if it could connect to the port.

Mailgun supports rapid sending of emails, so I wouldn't think they'd be throttling you, but there could be something else in the way, and that would be worth investigating. From what we can see here, Nagios doesn't seem to be stopping your mail.

I would also suggest reviewing your SSL and TLS configuration; you have those turned off--are you sure that's correct for your setup? It may be, but I'd want you to be sure.

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Tue Mar 03, 2020 10:00 am
by imadc
Thanks

Just attached the log /usr/local/nagiosxi/tmp/phpmailer.log from the past 2 days

From XI machine by telnetting to port 25 on the configured relay it is working and I am receiving emails normally on addresses under

[root@prodnagios ~]# telnet MTLRDMail.insurity.net 25
Trying 10.1.9.18...
Connected to MTLRDMail.insurity.net.
Escape character is '^]'.
220 MTLRDMail.insurity.net Microsoft ESMTP MAIL Service, Version: 10.0.14393.2608 ready at Tue, 3 Mar 2020 09:16:28 -0500

As for the TLS\SSL since internal emails are working normally do you think we need to use that to make it work to external addresses?

For the following we are able to ping them but not open over port 25. Do we need that especially that we have internal relay?

Feb 23 03:45:30 prodnagios postfix/smtp[31155]: connect to mxb.mailgun.org[34.218.165.121]:25: Connection timed out
Feb 23 03:56:00 prodnagios postfix/smtp[8961]: connect to mx.sendgrid.net[167.89.123.50]:25: Connection timed out

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Tue Mar 03, 2020 11:32 am
by imadc
Thanks issue is fixed now

Have to do with the contact vs user relationship

After deleted the contact and creating them in users issue is resolved

you can close the ticket and delete the attachements

Thanks
Insurity

Re: NagiosXI fail send outbound emails to external mailbox

Posted: Tue Mar 03, 2020 5:48 pm
by benjaminsmith
Good to hear.

The attachments have been deleted, and we'll lock this one up.

Thank you for using the Nagios Support Forum.