In this short tutotorial I will show you how you can use munin for monitoring bind9 queries. This could be useful to see your DNS Server load and to define alert limits.
First we have to create some directories for the log files used to track bind dns queries:
mkdir /var/log/bind9 chown bind:bind /var/log/bind9
Next we have to modify the „options config file“ used by bind9 /etc/bind/named.conf.options
logging { channel log { file "/var/log/bind9/bind.log" versions 30 size 1m; print-time yes; print-category yes; print-severity yes; severity info; }; channel query { file "/var/log/bind9/query.log" versions 2 size 1m; print-time yes; severity info; }; category default { log; }; category config { log }; category queries { query; }; };
To activate the bind9 munin plugin we have to set an symbolic link for it
ln -s /usr/share/munin/plugins/bind9 /etc/munin/plugins/bind9
and edit the file /etc/munin/plugin-conf.d/munin-node and add the following paragraph:
[bind9] env.logfile /var/log/bind9/query.log
After restart of munin-node via service munin-node restart you can see after some time, that a graph is genereated