Part II: The Munin-master
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
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName munin.blueheaven.ws
DocumentRoot /var/www/localhost/htdocs/munin
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ServerSignature On
</VirtualHost>
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.