Munin 2.0 on Debian
Munin 2.0 has been released and packaged for Debian, and even backported to Squeeze (from backports.debian.org).
Even though there are still some quirks in this version (or just the Debian packaging), it is far better (more scalable, more powerful and prettier) than version 1.4.
Basically, the following article should cover it all: http://munin-monitoring.org/wiki/CgiHowto2, but doesn’t quite achieve it, so far.
Let’s see together how to install it successfully on Debian Squeeze. I will however not cover the agent (Munin Node), as there is no significant difference between basic installation of its 1.4 and 2.0 versions.
As a first significant performance improvement, Munin is now able to use RRDcached (it fairly reduces the disk I/O pressure on RRD files), and it is fairly easy to setup. Just install package rrdcached (who would have guessed?), then add the following options to OPTS in /etc/default/rrdcached:
OPTS="-s munin -l unix:/var/run/rrdcached.sock -b /var/lib/munin/ -B -j /var/lib/munin/journal/ -F"
This will override its defaults. And of course, restart then the daemon.
Adapt /etc/munin/apache.conf to your likings, in this case, we are going to uncomment all cgi and fastcgi-related blocks.
Install packages libapache2-mod-fcgid and spawn-fcgi, then download the following script and install it as an initscript on your system (e.g. as /etc/init.d/spaw-fcgi-munin-graph and running insserv):
http://files.julienschmidt.com/public/cfg/munin/spawn-fcgi-munin-graph (though this version is still buggy and quite fragile, contact me for a slightly improved version)
apt-get install libapache2-mod-fcgid spawn-fcgi
Add user munin and www-data to group adm, and allow group adm to write to /var/log/munin/munin*-cgi-*.log:
adduser munin adm adduser www-data adm chmod g+w /var/log/munin/munin*-cgi-*.log
Add user www-data to group munin and the opposite:
adduser www-data munin; adduser munin www-data
Start the spawn-fcgi-munin-graph service and check it is indeed running.
Enable the fcgid and rewrite Apache modules and restart the Apache2 service.
Customize /etc/munin/munin.conf to your likings, enabling the (Fast)CGI parts.
Whenever monitoring more than a single host, I recommend moving (i.e. commenting and copying) the localhost definition to some new /etc/munin/munin-conf.d/ file per domain (e.g. beeznest.conf), and add your hosts there, with a meaningful domain name.