For When You Can't Have The Real Thing
[ start | index | login ]
start > nagios > check_dnsext

check_dnsext

Created by dave. Last edited by dave, 6 years and 147 days ago. Viewed 2,388 times. #4
[diff] [history] [edit] [rdf]
labels
attachments
(18 July 2012)

Sample Installation of check_dnsext

check_dnsext is availble here: >>http://exchange.nagios.org/directory/Plugins/Internet-Domains-and-WHOIS/check_dnsext/details

The author comments that Array::Compare isn't available through yum, but he's wrong. EL5 users can get it through rpmforge. In my case it required installing 14 other RPMs at the same time.

In my specific case, I want to check on the existence of SRV records for exchange autodiscover, because one of the hosting packages I use doesn't have native support for these records, and if the manually changed zone file gets re-written by the auto-writer then the SRV record disappears and needs to be manually re-created.

So here's how I did it:

/etc/objects/commands.cfg:

define command{
        command_name    check_dnsext
        command_line    /usr/lib/nagios/plugins/check_dnsext -H $ARG2$ -s $HOSTADDRESS$ -t SRV -a $ARG3$
        }

/etc/nagios/objects/macros.m4:

define(`DODNSSRVCHECK',`define service{
    use                 generic-service
    service_description ZONE-SRV-$2
    host_name           $1
    check_period        workhours
    normal_check_interval 20
    retry_check_interval 20
    notification_interval 10080
    check_command       check_dnsext!$1!$2!$3
} ')dnl

This has a sample invocation in the customer .m4 file as so (pre-supposing that the server gw-ns1 has already been defined):

DODNSSRVCHECK(`gw-ns1',`_autodiscover._tcp.gridway.net',`autodiscover.mygridway.net')

...which expands in the actual .cfg file to be:

define service{
    use                 generic-service
    service_description ZONE-SRV-_autodiscover._tcp.gridway.net
    host_name           gw-ns1
    check_period        workhours
    normal_check_interval 20
    retry_check_interval 20
    notification_interval 10080
    check_command       check_dnsext!gw-ns1!_autodiscover._tcp.gridway.net!autodiscover.mygridway.net
}
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt