Munin is a networked resource monitoring tool for monitoring your servers. Bind is most widely used open source software that implements the Domain Name System (DNS) protocols for the Internet. This manual doesn’t cover Munin or Bind installation, only the manual how to sync those two together to display queries from Bind inside Munin, here is how you do it :
1. Set some logging permissions for bind # mkdir /var/log/bind9 # chown bind:bind /var/log/bind9 # service bind9 restart 2. Edit /etc/bind/named.conf.options and add these settings: logging { Â Â Â Â Â Â Â channel b_log { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â file "/var/log/bind9/bind.log" versions 30 size 1m; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-time yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-category yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-severity yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â severity info; Â Â Â Â Â Â Â }; Â Â Â Â Â Â Â channel b_debug { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â file "/var/log/bind9/debug.log" versions 2 size 1m; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-time yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-category yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-severity yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â severity dynamic; Â Â Â Â Â Â Â }; Â Â Â Â Â Â Â channel b_query { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â file "/var/log/bind9/query.log" versions 2 size 1m; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â print-time yes; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â severity info; Â Â Â Â Â Â Â }; Â Â Â Â Â Â Â category default { b_log; b_debug; }; Â Â Â Â Â Â Â category config { b_log; b_debug; }; Â Â Â Â Â Â Â category queries { b_query; }; Â }; 3. Restart bind # service bind9 restart 4. Configure munin-node plugin # ln -s /usr/share/munin/plugins/bind9 /etc/munin/plugins/bind9 5. In /etc/munin/plugin-conf.d/munin-node make sure you have declared bind9 plugin: [bind9] user root 6. Restart munin-node # service munin-node restart 7. Enable rndc statistics in bind. Add a context inside /etc/bind/named.conf.options statistics-file "/etc/bind/zones/statistics"; zone-statistics yes; 8. Create zones directory and statistics file # mkdir /etc/bind/zones # chown bind.bind /etc/bind/zones # touch /etc/bind/zones/statistics # chown bind.bind /etc/bind/zones/statistics 9. Restart bind # service bind9 restart 10. Run rndc statistics # rndc stats 11. Enable bind9_rndc plugin in munin # ln -s /usr/share/munin/plugins/bind9_rndc /etc/munin/plugins/bind9_rndc 12. In /etc/munin/plugin-conf.d/munin-node make sure you have declared bind9_rndc plugin [bind9_rndc] user root env.querystats /etc/bind/zones/statistics 13. Restart munin-node # service munin-node restart 14. Create /etc/apparmor.d/local/usr.sbin.named and add this content: /var/log/bind9/** rw, /var/log/bind9/ rw, This should be all. Wait about 10 minutes that Munin graphs become visible and they will look like this:
Â
Leave a Reply