Page 1 of 1

Emails not receiving

Posted: Thu Jun 20, 2024 7:13 am
by mandar18
Hello Team,
I am not able to receive any email from Nagios Core.
I tried to send a test mail too but that also I did not receive it, I don't know what has happened.

Re: Emails not receiving

Posted: Thu Jun 20, 2024 4:49 pm
by bbahn
Hello @mandar18,

There are many reasons you may be having trouble with your email sending. Sendmail is frequently blocked by many networks and mail providers, so it's likely that your mail is blocked if you're trying to use a large mail provider. You can check if the method Nagios Core uses to send mail will work for you with this:

Code: Select all

echo "Test email body" | /bin/mail -s "Test Subject" [email protected]
Since Nagios Core uses Linux's /bin/mail to send mail, if this does not work or is blocked, then Nagios Core will not be able to send mail that way. Sendmail is a very common MTA (mail transfer agent) and is often blocked for security reasons.

If the above command works, then it means something somewhere is misconfigured. Since your test mail did not work, that indicates that the issue would lie with your contacts/contact templates or somewhere in that chain.

If the command doesn't work, then you will need to find another method of sending mail and update the commands for your contacts/contact templates to use your new functionality (the default mail sending commands should be notify-host-by-email and notify-service-by-email).

Here are some resources that may help in diagnosing your mail issues:
https://www.redhat.com/sysadmin/email-problems
https://www.linuxquestions.org/question ... 175474932/
You can also look in your system log location, which will likely have any errors with your mail sending listed there. The location of your syslog will vary based on the OS you are using, usually /var/log/syslog or /var/log/messages.