Monitoring DNS

ickyshuffle

26-03-2004 14:16:34

How did you setup the DNS stats monitoring? I would like to set that up but would love some help. ie Would you be willing to post the scripts or whatever you used to set up those stats?

silfreed

27-03-2004 09:51:13

Erm, those aren't quite ready for 'prime time' yet. They are a bit of a hack, and I'm not sure how well they'd run in other people's environments.
Just to describe how I get these stats (in case it won't be possible in your environment)
1) Configure Bind (the only DNS server that's supported right now) to log your query log to syslog; preferrably a facility.priority that is not used by anything else.
2) Create a named pipe for your querylog to go into
3) Configure syslog to output the facility.priority to the pipe you setup in #1 and #2
4) Setup a MySQL database for the dns statistics; create a user for the logging script and one for netmrg to read with
5) Put <this script I wrote that's not public yet> in /etc/inittab with the proper regex for your name servers (b/c syslog feeds are commonly corrupted - stupid UDP packets). Configure the script to log to the correct database.
6) Add a DNS Stats SQL test using the syslogname parameter and the type parameter from #7 and #8
7) Create a 'DNS Stats' subdevice with a 'syslogname' parameter and value that matches what your syslog feed's DNS hostname looks like
8) Add monitors with the DNS Stats SQL test with parameters for the type of query you want results for using (IN A, IN MX, etc)
9) build a template graph using these monitors
10) add it to your device

And each of these steps needs a good bit of fleshing out. The biggest problem is getting Bind and the query log parsing script configured.
I'll try to remember to post back when I get the script ready. I'm not sure how soon it will be, but it will probably show up in the contrib directory in CVS when it's ready.

-Doug

bware

28-05-2004 16:46:50

I know that powerdns supports mrtg compatible output for graphing the DNS performance (you can find the details in the documentation).

This should be quite easy to implement using netmrg.

I just installed netmrg, so I'm no expert ;) - but I have done this in cacti before.

silfreed

28-05-2004 17:01:30

Wow - I promised that script a long time ago.

It's available via CVS now (http//cvs.netmrg.net/index.cgi/contrib/bindstats/), so have at it if you want some nifty DNS info graphs.