[mrtg] Re: Monitoring requests for BIND9

josecarlos at corenetworks.org josecarlos at corenetworks.org
Tue Aug 27 09:46:02 MEST 2002


Ross Tsolakidis wrote:
> Hi all, 
> 
> Did a quick search of the archives to see how I could monitor requests to
> our DNS servers.
> Most of them point to the site :  http://mrtg.yeehaw.net/ 
> But apparently this is only for BIND 8
> 
> Does anyone know of a way to monitor BIND 9 ?
> 
> Thx.
> 
> --
> Ross.

	Hi all,

	you must configure your bind to do that:

#################
/etc/rndc.conf
key "rndc-key" {
         algorithm hmac-md5;
         secret "xxxxxxxxxxxxxxxxxxxxx";
};

options {
         default-key "rndc-key";
         default-server 127.0.0.1;
         default-port 953;
};
##################

##################
/etc/named.conf
.
.
.
zone "your_domain_to_monitor" IN {
	bla
	bla
	bla
	zone-statistics yes;
};
.
.
.
key "rndc-key" {
       algorithm hmac-md5;
       secret "xxxxxxxxxxxxxxxxxxxxx";
};
controls {
       inet 127.0.0.1 port 953
               allow { 127.0.0.1; } keys { "rndc-key"; };
};
####################

####################
/usr/local/mrtg-2/bin/estadisticas-dns.sh
# This scripts depends of the number of the domains to monitor
# For two domains
INLOG=/var/chroot/named/var/named/named.stats
OUTLOG=/var/chroot/named/var/named/named.stats.log
for a in `tail -19 $INLOG | head -18 | cut -d" " -f2` ; do
  /bin/echo -e $a "\c" >> $OUTLOG
done
echo >> $OUTLOG
####################

####################
crontab -l
*/5 * * * * /usr/local/sbin/rndc stats
*/5 * * * * /usr/local/mrtg-2/bin/estadisticas-dns.sh
####################

	Cheers.

PD: I'm working on a script to put this log on a mrtg database, is very 
similar...

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list