Page 6 of 13
Re: contacts.cfg is not working properly
Posted: Mon Oct 12, 2015 11:29 am
by hsmith
Can you have a quick read of
this? We're starting to get out of scope here troubleshooting email issues. This is related to the error that is showing there.
Re: contacts.cfg is not working properly
Posted: Mon Oct 12, 2015 12:59 pm
by sinkak
i dont see any misconfigs in mail Plus i am getting emails to alerts-warning from nagios.
But nothing on alerts911 email.
I cant figure this out.
Re: contacts.cfg is not working properly
Posted: Mon Oct 12, 2015 1:03 pm
by hsmith
It has to be something between your Nagios server and the email server. If that mail command cannot send to the account, there's no way you're going to receive the email alert.
Unixmen has a good tutorial for switching to using something other than the mail command. If you can't find any email configuration issues, this may be the best course of action for you.
Re: contacts.cfg is not working properly
Posted: Mon Oct 12, 2015 2:36 pm
by sinkak
i verified with different email addresses
/usr/bin/mail is not sending to yahoo email address or outlook either. its working only with gmail.
so definitely something wrong with the mail config.
Re: contacts.cfg is not working properly
Posted: Mon Oct 12, 2015 3:00 pm
by hsmith
The mail command has zero configuration. There is a lengthy manual page of options for it, but you don't configure it at all. It is not suitable for every environment. Yahoo! could be filtering it for a wide variety of reasons, it most likely thinks it is spam. I could list every single reason that sendmail could be getting filtered, but it's not something we have control over. You're going to want to switch to using SMTP. The article that I listed above is great,
and here is another one on Nagios Exchange.
Re: contacts.cfg is not working properly
Posted: Tue Oct 13, 2015 10:51 am
by sinkak
i installed sendEmail.
in order to use it with nagios it is asking for from email address and to address and server .
how can i give nagios email from address?
Re: contacts.cfg is not working properly
Posted: Tue Oct 13, 2015 11:07 am
by hsmith
Did you read the tutorial on UnixMen? It addresses exactly what you are asking.
http://www.unixmen.com/send-alerts-nagios-core-using-gmail-yahoo/ wrote:Configure Nagios Core to Send notification Using Gmail
In order to configure Nagios core to send alert using sendEmail and external smtp server like Gmail, you need to flow those steps:
Start by editing the resource.cfg file located in /usr/local/nagios/etc/resource.cfg :.....................
If you are getting some sort of error, can you post that?
Re: contacts.cfg is not working properly
Posted: Tue Oct 13, 2015 11:22 am
by sinkak
sendEmail is asking for server address , FROM address and TO address.
Code: Select all
/usr/local/bin/sendEmail -s SERVER[:PORT] -t toaddress -f fromaddress
where as /bin/mail/ has only TO address alone
its comes from nagios server. what FROM address i can give for nagios. and server address?
Re: contacts.cfg is not working properly
Posted: Tue Oct 13, 2015 11:27 am
by hsmith
I would just have it send from nagios@fqdnofemailserver. With SMTP you can put just about anything for the from address in my experience. I'm sure there's more to it than that, but it should work.
Re: contacts.cfg is not working properly
Posted: Tue Oct 13, 2015 11:40 am
by sinkak
i dont have smtp on my nagios server.
i have POSTFIX.
can i still use that dummy email for FROM address.
and what can i use for server address for postfix from local nagios host?