DNS Question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gregwhite
Posts: 206
Joined: Wed Jun 01, 2011 12:40 pm

DNS Question

Post by gregwhite »

We are trying to develop a set of standard services that would be applied to all websites and someone suggested using check_dns. So we rolled this out to our websites and about 10 of them failed to resolve. Looking into it I discovered that the reverse lookup did not work for this subset of websites. Before they add the reverse lookup to dns they are asking what the benefit of doing this check is. If it alerts critical what is it potentially telling us.
Thanks for you help.

Greg
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DNS Question

Post by ssax »

Here is a very good explanation:

http://support.simpledns.com/kb/a45/wha ... ed-it.aspx

Also here as well:

http://www.dnsstuff.com/reverse-dns-faq

Very handy for checking mail server lookups.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: DNS Question

Post by bwallace »

check_dns provides the benefit of proving increased server, services, and application availability as a result of the regular checks Nagios does against the DNS servers.
More importantly check_dns will enable you to quickly detect network outages and protocol failures as well as DNS hijacking and spoofing.

Perhaps check_http may be a better check to use against these sites you've mentioned?
http://nagios-plugins.org/doc/man/check_http.html

Do you just want to confirm these sites are reachable, or are you looking to check page content, etc? If the latter, then XI has 'website monitoring wizard' you can use:
https://www.youtube.com/watch?v=VL_vCCmZd3g
Be sure to check out the Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: DNS Question

Post by gormank »

I created new commands from check_dns yesterday to use the hostname and address from the host's config since check_dns didn't work as expected. It may be me not testing check_dns enough... Since $HOSTNAME$ on my system is the short name, I set things to allow $ARG1$ to be able to hold the domain part. $ARG1$ needs the trailing dot if used, per check_dns.
This way, if the IP (forward), or hostname (reverse) doesn't match what's defined in Nagios, there's an alert.

Code: Select all

define command {
       command_name                             check_dns_forward
       command_line                             $USER1$/check_dns -H $HOSTNAME$ -a $HOSTADDRESS$ $ARG1$
}

define command {
       command_name                             check_dns_reverse
       command_line                             $USER1$/check_dns -H $HOSTADDRESS$ -a $HOSTNAME$.$ARG1$ $ARG2$
}
Feel free to laugh at me or suggest a better solution...
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DNS Question

Post by ssax »

gormank, that's about the only way you can do it without changing the hostname/address to match.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: DNS Question

Post by gormank »

I'm not sure what you mean by "that" unless you agree with my tweak of the original. Hostnames and IPs match in Nagios and DNS or there's an alert, which is as intended.

Note that $ARG1$ can't contain info internal the host in Nagios so I'd have to make unique checks for each host. Yuck.

Code: Select all

define command {
       command_name                             check_dns
       command_line                             $USER1$/check_dns -H $HOSTNAME$ $ARG1$
}
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: DNS Question

Post by ssax »

I was agreeing with what you did.

What you could do is use a custom macro and put them on the hosts (the services will inherit them) and then use that instead of your $ARG1$:

https://assets.nagios.com/downloads/nag ... tvars.html

I'm trying to see if there's another way to do it, maybe using the search domain settings of the resolv.conf
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: DNS Question

Post by gormank »

Glad someone agrees w/ me. ;)
Its much cleaner to just define the commands once on the Nagios servers so I don't have to touch hundreds of boxes. Many hosts are 3par, Brocade, ILO, etc. so no NRPE.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: DNS Question

Post by rkennedy »

@gregwhite - let us know if you have any further questions.
Former Nagios Employee
Locked