[mrtg] Re: stat.pl for BIND 9.x

UK Internet Sites lists at ukinternetsites.com
Wed Feb 13 15:48:39 MET 2002


Hi,

Maybe this?

#!/usr/local/bin/perl

`rndc stats`;
@data = `tail -n 15 /home/DNS/named.stats`;

$old_ok = $data[0];
$old_fail = $data[5];
$old_ok =~ tr/^[0-9]\ //cd;
$old_fail =~ tr/^[0-9]\ //cd;

$ok = $data[8];
$fail = $data[13];
$ok =~ tr/^[0-9]\ //cd;
$fail =~ tr/^[0-9]\ //cd;

$ok = $ok - $old_ok;
$fail = $fail - $old_fail;
unless ($ok eq "0"){ $ok ++; }
unless ($fail eq "0"){ $fail ++; }

print "$ok\n$fail";

exit;


Not perfect but does the job :-)  It of course returns the number of requests both
sucessfull and not from the last time rndc was run.  Of course update the locations in the
script to your ones etc

Graeme Sandwell
UK Internet Sites Limited







>
>
> I could use a little help. I've done some looking around and have found
> some great info on MRTG with DNS stats (named.stats).
>
> I've got everything setup and ready to go but the stat.pl file doesn't
> return any data and Errors out on me. After going back through the README
> file(s), it looks like it was made for BIND 4x and 8x. DNS and BIND book
> says the format has changed between 8x and 9x
>
> Does anyone have a script for 9x.
>
> (Or would like to make one for me <grin>)
>
> Here is the sample of the output
>
> 9x named.stats
>
> +++ Statistics Dump +++ (1013610600)
> success 100068
> referral 6613
> nxrrset 659
> nxdomain 2027
> recursion 3353
> failure 87
> --- Statistics Dump --- (1013610600)
>
> Any help on this would be great!
>
> Thanks
> Blair
>
>
> --
> 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
>
>


--
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