LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-26-2007, 03:44 PM   #1
hondo
Member
 
Registered: Jul 2005
Location: norway
Posts: 198

Rep: Reputation: 33
E-mail notifications not working with nagios


Hi

The last time i was setting up nagios was on a quite big event and it worked like it should, but there was a problem with the e-mail notifications for nagios. Nagios was suppose to send out notifications when there were any problems with the servers, but this never happend / worked like it should. (Yes, i have read the nagios doc. and then also created the contact objects, contact groups etc.)

To troubleshoot this problem i first checked the nagios logs which indicated that nagios couldnt find the "mail" program which is used to send out the notification emails. It tried to look for the program in a directory on the system, but it wasnt the correct one. I fixed this problem with making a symlink from the directory the mail program was to the directory where nagios were looked for it. I now checked the logs for nagios again and it didnt say anything now about not finding the mail program and there was nothing that indicated that the emails werent sent..so they should then be sent. ..But even after a while (1 hour) i didnt receive any emails from nagios.

I now checked the mail logs for sendmail because i guess nagios is using this as the default MTA. There was no indication from these logs that the mails werent sent, so they should have been sent. I then looked in the mail queue where i found all the mails, lined up together, waiting to be sent. ..But after a while they just timed out, all of them.

I cant seem to see what the problem is there, nagios is sending mail when there is a problem, but the mail just stays in the mail queue and times out..what is wrong here? ..I have tried to remove all firewall, but there is no change at all. Port 25 is after what i understand the only one needed to be open for these email notifications to work..and it should be open.

I dont have the logs now from this, because this happened a some weeks ago now, but i still have some test config for nagios which have the exact same problem.

I would appericiate any help with this problem as it seems to be q tricky subject. Thanks.

Last edited by hondo; 10-26-2007 at 03:47 PM.
 
Old 10-27-2007, 02:44 PM   #2
scotlarsen
Member
 
Registered: Sep 2006
Posts: 35

Rep: Reputation: 15
Where is nagios sending email notifications to? Is it to a mail server you manage? Can you manually send email using the mail program from your nagios server to the email address you have specified in nagios? I think the approach you want to take is to first figure out if it's a nagios problem, a sendmail problem or a network problem blocking port 25 (firewall, ISP, etc.).
 
Old 10-28-2007, 12:12 PM   #3
hondo
Member
 
Registered: Jul 2005
Location: norway
Posts: 198

Original Poster
Rep: Reputation: 33
Thanks for your reply. Nagios is sending email notifications to an email address specified in one of the contect objects. You bring up a pretty good point about trying to see if the mail program actully will send the mail. But, since the email has been sent to the mail queue i guess that there is nothing wrong with this program and that the problem would be more sendmail/network related. I cannot see how this would be a nagios problem, when the mail is being sent from nagios.

You dont have to have a mail server running to be able to send mail with the mail program, at least that would be weird ..and from where i stand, port 25 should be open, so it might be that the ISP is blocking it, is there any way to check this? I know my ISP is blocking port 80 (i dont know this was found out)..but im not sure if they block port 25. If they are blocking port 25, then why would they do this, so noone can send mail?

Last edited by hondo; 10-28-2007 at 12:14 PM.
 
Old 10-28-2007, 12:42 PM   #4
scotlarsen
Member
 
Registered: Sep 2006
Posts: 35

Rep: Reputation: 15
$ dig mx domain_you_are_sending_mail_to

$ telnet mx_server_from_above 25

If you can see you are talking to the mail server port 25 is not blocked and if you can't:

# service iptables stop

and try again. If it's still blocked:

# service iptables start

If it's your iptables firewall causing the problem you'll have to make the appropriate changes to your iptables config and restart the service.

Your ISP is probably blocking port 25 (outbound) except to it's own smtp server(s) as many of them do nowadays in an effort to help thwart spammer attempts to exploit open relay mail servers (e.g. poorly configured ones).

If it is blocked (as is mine with my home ISP) you might want to look in to setting up sendmail to use your ISP's mail server as a mail relay. Note: you may have to setup sendmail to use smtp authentication to connect to your ISP's mail server.

Last edited by scotlarsen; 10-28-2007 at 04:47 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nagios & SMS notifications. mastrboy Linux - Software 4 03-21-2010 09:44 AM
Thunderbird mail notifications satinet Slackware 6 07-18-2006 02:28 PM
KDE 3.4 Sound Notifications not working joncbl Linux - Software 8 04-17-2005 04:14 PM
No e-mail notifications ilikejam LQ Suggestions & Feedback 3 08-07-2004 07:30 PM
system notifications not working hobylinux Linux - Newbie 0 07-20-2003 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration