Munin 2.0 on Debian

Munin 2.0 has been released and packaged for Debian, and even backported to Squeeze (from

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:, 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): (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.

  1. September 30, 2012 at 11:57 am


    Thank you for this tutorial. I tried to use your init script on a small arm-based debian squeeze server and get an error when starting it by hand. The -U flag (in -U www-data) is unknown for spawn-cgi 1.4.19. It seems not related to user or group (since the -u and -g flags are alos used in your script with munin user and group). How should I change this script?

  2. November 17, 2012 at 11:19 am


    I followed your tips on an Ubuntu 12.04 server (installed Munin v2.0.2), but the only problem I have is that if I change html_strategy to cgi my html don’t get generated anymore. graph_strategy cgi works fine, the munin-cgi-graph.log shows graph generation etc.
    Only thing is that to be able to see those graphs, I need to change html_strategy back to cron and wait till the cron runs.

    Any idea what I might be doing wrong here? I’m guessing that since graph_strategy cgi works, I’ve probably done all the Apache/FCGI configuration correctly, so maybe it’s a permissions issue? Can’t seem to find any errors in the logs in order to help me pinpoint the cause…

    • June 20, 2013 at 2:47 pm

      It is pretty tricky to get right, and some (most?) versions of Munin 2.0.x are known to be buggy with CGI.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: