Here are the details of some Mon tests I run:


The following tests the local DNS cache. I didn’t use in my real tests, I used the domain of a multi-national corporation that has a very short DNS timeout that seems related to their use of the Akamai CDN. I won’t tell people which company to use, but I’m sure that any company that can afford Akamai can afford a query from my server every 5 minutes. ;)

  service dnscache
    description DNS caching
    interval 5m
    monitor dns.monitor -caching_only -query
    numalerts 1
    alert mailxmpp.alert -x -m
    upalert mailxmpp.alert -x -m

The following section of monitors Google DNS for the validity of domains that I host on my name server. The aim of this is to catch the case where someone forgets to pay for zone renewal so that they can pay while the zone is locked before it becomes available for domain squatters. It uses M4 so it can be generated from the BIND configuration.

  service myzones
    description check Google DNS has my zones
    interval 1h
    monitor dns.monitor -caching_only QUERYDOMAINS
    numalerts 1
    alert mailxmpp.alert -x -m
    upalert mailxmpp.alert -x -m

The following Makefile generates a file from the BIND configuration that monitors the www entries in zones and the first PTR entries in IPv6 reverse zones. Note that the spaces will need to be converted to a TAB if you want to cut/paste this.

all: /etc/bind/named.conf.local Makefile
        m4 -DQUERYDOMAINS="$(shell for n in $$(grep zone /etc/bind/named.conf.local|sed -e s/^zone..// -e s/\"\ .$$//|grep -v ^//| grep -v arpa$$ ; for n in $$(grep zone.* /etc/bind/named.conf.local|sed -e s/^zone..// -e s/\”\ .$$//|grep -v ^//) ; do echo -query$$n:PTR ; done) ; do echo -query www.$$n ; done)" >
        /etc/init.d/mon restart

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>




IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 10 + 15 ?
Please leave these two fields as-is: