LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HELP! Nagios email notification using Postfix (https://www.linuxquestions.org/questions/linux-newbie-8/help-nagios-email-notification-using-postfix-862773/)

tagzfernando 02-15-2011 02:36 AM

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

EricTRA 02-15-2011 03:43 AM

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

EricTRA 02-15-2011 03:48 AM

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

tagzfernando 02-15-2011 09:22 AM

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

EricTRA 02-15-2011 09:28 AM

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

EricTRA 02-15-2011 09:31 AM

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

tagzfernando 02-15-2011 09:42 AM

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

EricTRA 02-15-2011 09:44 AM

Hello,

You're welcome, looking forward to your response.

Kind regards,

Eric

tagzfernando 02-15-2011 08:06 PM

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

EricTRA 02-16-2011 01:24 AM

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

tagzfernando 02-16-2011 08:35 AM

Hi Eric,

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

Many thanks,
Tagz

EricTRA 02-16-2011 08:45 AM

Hello,

OK, looking forward to it.

Kind regards,

Eric

tagzfernando 02-16-2011 09:34 AM

HI Eric,

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

Thanks
Tagz

EricTRA 02-16-2011 09:42 AM

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

tagzfernando 02-16-2011 08:08 PM

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


All times are GMT -5. The time now is 12:04 PM.