[collectd] bind9 nameserver plugin?

Claus Herwig lists at checon.de
Fri May 5 13:02:22 CEST 2006


Hi Florian,

> Do you know of another way to get the values than calling `rndc status'
> and parsing the status-file? 

thats not exactly what I had in mind ;-) "rndc status" shows almost no
information, unfortunately. At least with my version, which is 9.3.2
(debian backports).

At the moment I'm using "bindgraph", which gives you really nice
graphics of the different types of queries. I'll attach a small png FYI.
But bindgraph depends on some perl voodoo and it needs the bind querylog
as a file - which is a Bad Thing (tm) because even with my small to
medium nameserver this leaves you with several hundred MByte of logs per
day. Additionaly its difficult to rotate/delete them properly because of
bind and this constantly running perl script.

That said, my idea was to use syslogd to log the bind querylog to a
named pipe. syslogd somehow writes to the pipe in nonblocking mode, i.e.
collectd could attach to the pipe, read and parse the lines and detach
again. Nothing would be lost as long as collectd attaches every few
minutes (or more often, of course).

But there are some problems: I do know nothing about the buffersizes of
syslogd or of named pipes - how many lines will fit in the buffer? What
happens to the pipe buffer, if for some reason syslogd is running, but
collectd is not? Do named pipes behave the same way on different
platforms? I only tried it with linux on i386...

If anybody wants to try this setup - put this in the logging section of
your named.conf:
----
logging {
  channel "querylog" { syslog local3; };
  category queries { querylog; };
};
----
And this in your syslog.conf
----
local3.*	|/var/log/bind.querylog
----
After a HUP to syslogd and "rndc reload" the "rndc status" should say
query logging is on, otherwise give it a "rndc querylog" command first.
Now you can use
cat /var/log/bind.querylog
to listen to the pipe...

Greets,
  Claus

-- 
CHECON   EDV-Consulting und Redaktion
         Claus Herwig * Barer Straße 70 * 80799 München
         +49 89 27826981 * Fax 27826982 * c.herwig at checon.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bindgraph.PNG
Type: image/png
Size: 39272 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20060505/30f123b5/bindgraph-0001.png


More information about the collectd mailing list