LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-26-2013, 01:10 AM   #1
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Rep: Reputation: 1
Unable to receive notification/alerts mail from nagios


Hi,

I have installed nagios in centos and I have mentioned my gmail email address in mycontacts.cfg. But still I don't receive any notification/alerts mail from nagios. Please help.
 
Old 01-26-2013, 04:08 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Did you set up a mail transfer agent to send out the mails? Nagios does not come with one included so you'll need to take care of that yourself. In other words, can you send out mails from the command line on that same machine?

Kind regards,

Eric
 
Old 01-26-2013, 09:26 AM   #3
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Original Poster
Rep: Reputation: 1
hi eric,

I need to set up postfix server for that. But do I also need to set up DNS server for postfix?? Can you please let me know what are the changes should I make in /etc/postfix/main.conf ???
 
Old 01-26-2013, 10:22 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
You do not need a DNS server, as long as your box is able to resolve names normally using an external DNS (e.g. provided by your ISP). In all likelihood, your ISP filters outgoing SMTP traffic in an effort to limit spam. You probably need to relay outgoing mail through your ISP's SMTP server -- see this page for details (it's for Ubuntu, but the process should be the same on any distro). If this doesn't work, you'll need to check your postfox logs to figure out why mail is not being delivered.

Last edited by btmiller; 01-26-2013 at 10:55 AM. Reason: typo
 
Old 01-26-2013, 10:33 AM   #5
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Original Poster
Rep: Reputation: 1
Hi btmiller,

I saw the webpage provided by you and only one line modification has to be made right. That is relayhost=your.server.com

For example:

ISP has given me an external DNS IP, that is 203.196.128.4

In /etc/postfix/main.cf, if I edit the line relayhost=203.196.128.4 and restart the postfix service

Will it work and will nagios be able to send alerts to my gmail address which I have mentioned in contacts.cfg????
 
Old 01-26-2013, 10:58 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
No, the relayhost needs to be the name or IP address of your ISP's SMTP server. Do they provide that for you? If not, perhaps your machine is allowed to directly make outgoing SMTP connections and you do not need a relay host. Is this machine on a residential Internet connection or in a data center/colocation facility or a VM with a cloud hosting provider? Generally, ISPs filter traffic very differently between these types of machines. Most ISPs don't allow residential users to make arbitrary SMTP connections, as this has been abused by various sorts of malware. In any case, your ISP/provider should be able to tell you if there are any restrictions on outgoing mail from their network. If they require you to forward all mail through their SMTP server, you should set this as the relayhost. If not, you need not bother configuring it, but maybe gmail is rejecting your mail for other reasons, again check your logs to see what is happening!
 
Old 01-26-2013, 11:32 AM   #7
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Original Poster
Rep: Reputation: 1
Hi btmiller,

This machine is in the data center and I have set up the data center. we have 2MBPS lease line. The ISP has given us five IPs, subnet mask as 255.25.255.248 and one gateway IP with two DNS IP's. So I have configured one IP on firewall and I have mapped my system IP (192.168.x.xx) with the external IP given by ISP. So I can access my system from anywhere. ISP didnt give us any SMTP server IP and there are no restrictions and they didn't tell us that all mails should be forwarded from their SMTP server. That means it is completely open.
 
Old 01-26-2013, 01:45 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
OK, then you probably don't need to set a relay host. If your mails aren't being delivered, you'll have to look at the postfix logs to see why.
 
Old 01-26-2013, 02:17 PM   #9
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Original Poster
Rep: Reputation: 1
h btmiller,

Now I am receiving the mail alerts in gmail as spam. But I want the mails to come in my inbox. Please tell me how can I do it??
 
Old 01-26-2013, 02:20 PM   #10
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 55

Original Poster
Rep: Reputation: 1
This is the postfix mail log I saw by running tailf /var/log/maillog

relay=gmail-smtp-in.l.google.com[173.194.70.26]:25, delay=1776, delays=1764/0.01/8.2/3.8, dsn=2.0.0, status=sent (250 2.0.0 OK 1359227883 l8si8551659eem.93 - gsmtp)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 - Auto Acknowledging Alerts After many tries/sends notification deibertine Linux - Software 4 11-14-2012 08:24 AM
Nagios email notification unable to work with Nail Mail fabbie Linux - Server 3 10-23-2009 12:01 AM
Nagios mail Alerts hoshie66 Linux - Server 2 09-17-2009 09:25 AM
E-mail notification with Nagios Hiroyatamoto Linux - Newbie 7 06-30-2009 12:18 PM
Unable to receive QCustomEvent notification gordonj Linux - General 0 03-26-2004 06:54 AM


All times are GMT -5. The time now is 08:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration