Munin/Bind9 Plugin

From Debuntu

Jump to: navigation, search

This set up was made on Debian Lenny

Contents

Bind9 Plugin

bind9 server config

Bind server needs to be configured to log queries. You can do so by adding to /etc/bind/named.conf.options

logging {
        channel b_query {
                file "/var/log/bind9/query.log" versions 2 size 1m;
                print-time yes;
                severity info;
        };
        category queries { b_query; };
};

Now, make the directory and give it the right permission:

# mkdir /var/log/bind9
# chown bind:bind /var/log/bind9
# /etc/init.d/bind9 restart

munin node config

Set up the file correctly:

# ln -s /usr/share/munin/plugins/bind9 /etc/munin/plugins/bind9
# touch /var/lib/munin/plugin-state/bind9.state
# chown munin:munin /var/lib/munin/plugin-state/bind9.state

In /etc/munin/plugin-conf.d/munin-node make sure you have declared bind9 plugin:

[bind9]
user root

and restart munin-node

# /etc/init.d/munin-node restart

Bind9_rndc Plugin

bind9 server config

Your default bind install should already write to /var/cache/bind/named.stats when running the command:

# rndc stats

If not, make sure you have the following directive within options group in /etc/bind/named.conf.options:

        statistics-file "/var/cache/bind/named.stats";

Now, restart bind:

# /etc/init.d/bind9 restart

munin node config

First, link the plugin to Munin plugin folder:

# ln -s /usr/share/munin/plugins/bind9_rndc /etc/munin/plugins/bind9_rndc

In /etc/munin/plugin-conf.d/munin-node make sure you have declared bind9_rndc plugin:

[bind9_rndc]
user root
env.querystats /var/cache/bind/named.stats

and restart munin-node

# /etc/init.d/munin-node restart

Lenny patch

Warning.png
Debian Lenny patch required
On Debian Lenny, a patch is required to get this plugin working. This patch is taken from http://munin-monitoring.org/ticket/627

Here is the patch: media:bind9_rndc.patch

To apply this patch go to /usr/share/munin/plugins/ and apply:

# patch -p1 < /path/to/bind9_rndc.patch
<pre>

= Testing the plugins =
To test the plugins run:
<pre>
# munin-run <plugin_name>
# munin-run bind9
query_MX.value 1
query_PTR.value 186
query_A.value 743
query_SRV.value 44
query_NS.value 5
query_SOA.value 27
query_AAAA.value 1618
query_other.value 0
# munin-run bind9_rndc
query_recursion.value 350
query_authoritative_answer.value 320
query_successful_answer.value 817
query_non_authoritative_answer.value 2288
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense