Page 1 of 1

E-mail server not reflecting change.

Posted: Thu Apr 04, 2019 8:54 am
by gnikolov
Hello,

I run NagiosXI 5.4.13 on CentOS 7.
I had set up an e-mail server, though it turned out I have a typo and now, when I enter the correct address the test mail arrives without problems, but the notifications themselves don't arrive. What puzzles me is that apart from the wrong mail server I have typed, I see messages for another server within our company, that Nagios shouldn't know about and also messages for relaying through googlemail.com servers.
I have seen some similar issues on the forums, but the solutions didn't work.(stop nagios, ndo2db, mysqlcheck -f -r -u root -pnagiosxi --all-databases --use_frm, restart mysql and start nagios and ndo2db).
I see the change is reflected in the table xi_options but for some reason mails are not sent to it.
I have inspected
/usr/local/nagiosxi/tmp/phpmailer.log - here I don't see messages for the notifications, only for the test mails
/var/log/maillog - here I see messages for wrong mail servers.

P.S. I found out that the server that is within our company and Nagios shouldn't know about is one of our relays, but this still doesn't explain why I receive an e-mail with the test and I get: "stat=Deferred: Connection timed out with <relay server name>" for the actual notifications. Can you please shed some light on the logic differences between the test mail and the actual mail?

P.P.S. The googlemail server disappeared from the logs after restart of the machine(still don't know why it was there in the first place and why Nagios was trying to connect to it)

Re: E-mail server not reflecting change.

Posted: Thu Apr 04, 2019 2:04 pm
by tgriep
I would suspect that the settings in the Admin > Manage Emails settings menu are set to use the Sendmail Mail Method, it that correct?

If so, when that settings is used, Nagios will use the local mailer to send the emails. Typically the postfix daemon is used.

If the default settings for postfix were not changed, and it tries to send an email, it will look up which mail exchange server to use automatically through DNS.
That is where it is getting the servers that it does not know about. It probably keeps using the same servers until the daemon is restarted, that is why rebooting the server changed things.

The difference between the test email and the normal emails is probably caused by an invalid from email.
When the test was sent, the from address is valid. When the Notifications are sent, it uses the from address from the Admin > Manage Emails settings menu.
Make sure that is a valid from address.

I have a suggestion. Change the Mail Server settings to use a SMTP server in the Manage Emails settings menu.
That way, you know for sure which server the Nagios server will send the emails to. Or configure the postfix daemon to use a internal relay server.
That will stop the "randomness" when emails are sent.

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: E-mail server not reflecting change.

Posted: Fri Apr 05, 2019 6:10 am
by gnikolov
Hi,

The setting used is SMTP

The "Send Mail From" setting is set to Nagios XI <[email protected]> (The x-es are other letters, I have just ommited them)

I have only set settings in the "Manage Email Settings" section - everything else I have accessed is just on read-only basis to troubleshoot this issue. The test e-mail I refer to is the one, triggered with the button in the "Manage Email Settings"

One additional thing I see is that, if the configured smtp server is: smtp.company.info, and I do tcpdump on both machines - only the test e-mail generates traffic between them.

Re: E-mail server not reflecting change.

Posted: Fri Apr 05, 2019 11:30 am
by benjaminsmith
Hi @gnikolov,

I believe this is network, firewall or mail server issue. However, can you send us your system profile and we can take a look at your configuration settings?

To Send Over a System ProfileTo send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it to a cloud storage of your choice. You can share a link with me in a personal message.
After you upload the profile please post something in this thread to bring it up in the support queue.

Thank you.

Re: E-mail server not reflecting change.

Posted: Thu Apr 11, 2019 9:55 am
by gnikolov
Hi,

you have a PM.

Re: E-mail server not reflecting change.

Posted: Thu Apr 11, 2019 12:41 pm
by benjaminsmith
Hi @gnikolov,

I just sent a reply to your private message.