Howto munin and rrdcached on ubuntu 12.04
Let's expect you already have Munin installed and working and you want to reduce disk I/O and improve responsiveness by adding rrdcached... Here are the complete steps to integrate rrdcached:
Basic Installation
First install the stock packageapt-get install rrdcachedand integrate it with Munin:
- Enable the rrdcached socket line in /etc/munin/munin.conf
- Disable munin-html and munin-graph calls in /usr/bin/munin-cron
- Create /usr/bin/munin-graph with
#!/bin/bash nice /usr/share/munin/munin-html [email protected] || exit 1 nice /usr/share/munin/munin-graph --cron [email protected] || exit 1
and make it executable - Add a cron job (e.g. to /etc/cron.d/munin) to start munin-graph:
10 * * * * munin if [ -x /usr/bin/munin-graph ]; then /usr/bin/munin-graph; fi
The Critical Stuff
To get Munin to use rrdcached on Ubuntu 12.04 ensure to follow these vital steps:- Add "-s <webserver group>" to $OPT in /etc/init.d/rrdcached (in front of the first -l switch)
- Change "-b /var/lib/rrdcached/db/" to "-b /var/lib/munin" (or wherever you keep your RRDs)
OPTS="-s www-data -l unix:/var/run/rrdcached.sock" OPTS="$OPTS -j /var/lib/rrdcached/journal/ -F" OPTS="$OPTS -b /var/lib/munin/ -B"If you do not set the socket user with "-s" you will see "Permission denied" in /var/log/munin/munin-cgi-graph.log
[RRD ERROR] Unable to graph /var/lib/munin/ cgi-tmp/munin-cgi-graph/[...].png : Unable to connect to rrdcached: Permission deniedIf you do not change the rrdcached working directory you will see "rrdc_flush" errors in your /var/log/munin/munin-cgi-graph.log
[RRD ERROR] Unable to graph /var/lib/munin/ cgi-tmp/munin-cgi-graph/[...].png : rrdc_flush (/var/lib/munin/[...].rrd) failed with status -1.Some details on this can be found in the Munin wiki.