LinuxQuestions.org
Review your favorite Linux distribution.
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 02-15-2011, 02:36 AM   #1
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Rep: Reputation: 0
Smile HELP! Nagios email notification using Postfix


Hi to All,

My Nagios email Notification is not working,I'm trying to setup external relay server using GMAIL. I'm also using dynamic IP.

Please see the test below

tagz-jabez postfix # sendmail -bv tagzfernando@gmail.com
Feb 15 16:09:14 tagz-jabez postfix/qmgr[29896]: C3E9C10567: from=<>, size=1842, nrcpt=1 (queue active)
Feb 15 16:09:29 tagz-jabez postfix/smtp[1593]: C3E9C10567: to=<root@smtp.gmail.com>, relay=none, delay=3291, delays=3276/0.03/15/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.gmail.com type=MX: Host not found, try again)
tagz-jabez postfix #

Here is my PoSTFIX CONFIGURATION

myhostname = tagz-jabez
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = smtp@gmail.com,tagz-jabez, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
default_transport = smtp
relay_transport = smtp
myorigin = /etc/mailname
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"

Appreciate all your help on this problem.

thanks
Tagz
 
Old 02-15-2011, 03:43 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello and Welcome to LinuxQuestions,

Please don't post your problem/question in multiple forums. Doing this will only confuse you and us and take the focus of the conversation. Keep it in this conversation.

Kind regards,

Eric
 
Old 02-15-2011, 03:48 AM   #3
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

It's been a couple of months since I've set up Postfix with GMail but from what I recall it doesn't quite work with dynamic IP addresses. Anyway below is what I used some time ago and which up to date is functional (with fixed IP, not dynamic).

Code:
myhostname = srvnagios.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smtp.gmail.com, localhost, srvnagios.domain.com
relayhost =
mynetworks = 172.25.0.0/16,127.0.0.0/8,192.168.0.0/16,10.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost,172.25.192.35
canonical_maps = hash:/etc/postfix/canonical
relay_domains = srvnagios.domain.com
The relay_domains is there because this server functions as a relay server for other servers in the same network. You'll notice there are some differences, like for example you have smtp@gmail.com in your config which isn't clear to me if it's a typo or effectively existing in the config file.

Kind regards,

Eric
 
Old 02-15-2011, 09:22 AM   #4
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,

Sorry about the double post, its a typo it should be smtp.gmail.com. How do you get the svgnagios.domain.com?
I'm confused on where to find the myhostname..

Thanks,
Tagz
 
Old 02-15-2011, 09:28 AM   #5
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

The command:
Code:
hostname -f
will print your FQDN (Fully Qualified Domain Name) on screen. Check your connectivity to Gmail with the following:
Code:
telnet smtp.gmail.com 995
You should get some output like this:
Code:
Trying 74.125.67.109...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
which you should exit with the CTRL ] combination and then quit if it gives you a telnet> prompt.

Kind regards,

Eric
 
Old 02-15-2011, 09:31 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

Also, did you read the part where I said that it doesn't quite work when you're behind a dynamic IP, since GMail blocks those some way or another? At least that's what I found out when talking to Google at my former job.

Kind regards,

Eric
 
Old 02-15-2011, 09:42 AM   #7
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,

Thanks for the fast response,i'm going to test it tomorrow.i'm also aware of gmail's limitation when using dynamic IP.

Thanks,
Tagz
 
Old 02-15-2011, 09:44 AM   #8
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

You're welcome, looking forward to your response.

Kind regards,

Eric
 
Old 02-15-2011, 08:06 PM   #9
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Eric,

I got this error message when I check telnet session

tagz-jabez etc # telnet smtp.gmail.com 995
telnet: could not resolve smtp.gmail.com/995: Name or service not known

Could this be the root cause of the problem?

thanks as always,
TAGZ
 
Old 02-16-2011, 01:24 AM   #10
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

Sure looks like it It looks like you don't have internet access at all or that they're something blocking specific things. If you get an error like that it means, just like the error states, that the URL you're requesting cannot be resolved to an IP address using DNS. Can you post the contents of your /etc/resolv.conf file?

Kind regards,

Eric
 
Old 02-16-2011, 08:35 AM   #11
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Eric,

It is most likely they're blocking the smtp port, sure I will post the configuration tomorrow.

Many thanks,
Tagz
 
Old 02-16-2011, 08:45 AM   #12
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

OK, looking forward to it.

Kind regards,

Eric
 
Old 02-16-2011, 09:34 AM   #13
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
HI Eric,

Just want to ask, have you tried using Zenoss?Is it more complicated than nagios?

Thanks
Tagz
 
Old 02-16-2011, 09:42 AM   #14
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

I personally never used nor installed it but a good friend of mine just told me he has installed and used it. His findings were that it's easier to install and configure but that Nagios has more 'power', meaning possibilities. Those are his words, not mine, but I confide a lot in his experiences.

Kind regards,

Eric
 
Old 02-16-2011, 08:08 PM   #15
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Eric,

I guess Nagios is still the king..Please see the output from resolv.conf

# Generated by NetworkManager
nameserver 192.21.200.29

thanks,
Tagz
 
  


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 Email Notification Assistance deibertine Linux - Newbie 7 10-05-2012 12:19 PM
Nagios email notification sendmail fails - extra $ is added claushoyer Linux - Software 3 04-14-2011 06:16 AM
Nagios has stopped sending email notification s deibertine Linux - Software 7 05-06-2010 08:22 PM
Nagios email notification unable to work with Nail Mail fabbie Linux - Server 3 10-22-2009 11:01 PM
Setting up Nagios with Notification w/ Exchange/Postfix??? ZiPPygEEk Linux - Newbie 5 05-19-2009 10:23 AM


All times are GMT -5. The time now is 08:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration