contacts.cfg is not working properly

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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.
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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.
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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.
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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

Code: Select all

/usr/bin/mail -s "** test Service Alert: test/test is test **" "[email protected]"
its comes from nagios server. what FROM address i can give for nagios. and server address?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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.
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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?
Locked