Part II: The Munin-master

Hopefully you’ve read the first part(Munin-Node), and have one or more nodes already configured. It’s alright if the munin-node is running on the same machine as the munin-master. The master is more of a pain to set up than the client, and could require significantly more debugging.

First off, you’re going to have to install the munin package. You’ll also need to have a web server installed, I prefer apache:

# For Gentoo,
emerge munin apache
# For CentOS/Fedora
yum install munin apache
# For Debian
aptitude install munin apache

Gentoo and CentOS both install the HTTP root in /var/www/localhost/htdocs/munin. After setup, the graphs will be available at http://localhost/munin

Debian requires a bit more attention. Debian munin installs the HTTP root in /var/www/munin. so after the setup, a vhost will have to be created to access it. To do this(on Gentoo) I created an apache vhost file, /etc/apache2/vhosts.d/08_munin.conf. On Debian, the file is the same but the path is different, /etc/apache2/sites-available/08munin


ServerAdmin root@localhost
ServerName munin.blueheaven.ws
DocumentRoot /var/www/localhost/htdocs/munin

Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ServerSignature On

If you set up the Vhost, you’ll need to create the appropriate DNS entry, and kick apache.

/etc/init.d/apache2 reload

Now we have to deal with the configuration of munin itself. There’s only one file for the munin-master configuration, and it resides at /etc/munin/munin.conf. Note: Depending on your operating system, these paths might be different!

dbdir /var/lib/munin
htmldir /var/www/localhost/htdocs/munin
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
[ponderosa]
address 127.0.0.1
[colo;fortress.dionysian-mind.net]
address 10.0.9.252
[colo;maetel.dionysian-mind.net]
address 10.0.9.3

Each section beginning with a hostname, such as “[ponderosa]” is a munin-node reached at the address attribute. To group hosts you may prefix them with a a group name followed by a semicolon, such as “[colo;maetel.dionysian-mind.net]”. This will make more sense when you actually see the HTML pages.

There is no munin-master daemon! The munin master is a cron job run by the munin user and resides at /var/spool/cron/crontabs/munin. This file is installed when munin is installed through your package manager.

Ideally that’s all you’ll have to do to set the munin-node up. You could wait 5 minutes and check http://localhost/munin to see if the graphs are generated correctly, or you could try running things by hand to make sure they work properly. Under no circumstances run this as root, you’ll screw up your permissions. To run the munin cron job by hand:

sudo su - munin
/usr/bin/munin-cron

If for some reason the master refuses to work, inspect the logs located in /var/log/munin. Additionally you may netcat/telnet to the node in the same way references in Part I.

If all goes well you should be able to load up http://localhost/munin and view your pretty graphs! If your organization uses cfEngine continue on to Part III to learn about how we use Munin at the OSUOSL.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.