Nagios Email-LAN Notification

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
faziz
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Nagios Email-LAN Notification

Post by faziz »

Hello

I have nagios core send notification to public emails, but when i change to send mails to local IP of exchange server through LAN not WAN, it did not work and I got below errors

dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=... type=MX: Host not found, try again)

Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Email-LAN Notification

Post by mcapra »

This sounds like a problem (but not really a problem; more like a security feature) on the Exchange side of things.

Have you tried resolving the DNS in /etc/hosts to use the LAN address instead of hard-coding it? Then, in your notification handler, using the DNS.

If that doesn't fix things, it would be helpful to see the exact notification handler you've configured.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Email-LAN Notification

Post by scottwilkerson »

faziz wrote:dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=... type=MX: Host not found, try again)
The server is getting this from the server you are sending to.

I would also verify that the "From" address your system is sending from is valid, this may be why your exchange server is rejecting the message
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
faziz
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios Email-LAN Notification

Post by faziz »

I write in /etc/hosts to resolve locally, but did not work
I don't think issue from From, because when i use WAN link it is working fine, but when I use LAN to resolve locally I got this error;
Is there method I can send emails from nagios to Firewall? and from firewall I already relay emails to mail server
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Email-LAN Notification

Post by scottwilkerson »

Does the exchange server recognize the To: and From: addresses? there is part of the error you clipped which shows what Host not found
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
faziz
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios Email-LAN Notification

Post by faziz »

If that doesn't fix things, it would be helpful to see the exact notification handler you've configured.
From where I can get this?
Does the exchange server recognize the To: and From: addresses? there is part of the error you clipped which shows what Host not found
Yes,
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Email-LAN Notification

Post by scottwilkerson »

faziz wrote:
If that doesn't fix things, it would be helpful to see the exact notification handler you've configured.
From where I can get this?
You would look at the contact you have configured in nagios, and see what the name of the command is you specified for host_notification_handler and service_notification_handler

then look in your commands configuration to see the command.
faziz wrote:
Does the exchange server recognize the To: and From: addresses? there is part of the error you clipped which shows what Host not found

Yes,
If the exchange server recognizes this host, are you sure the host has a MX record in DNS? because the server you are sending to is reporting "Host or domain name not found" when doing a MX lookup
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked