, Johann Schmitz

Some days ago, i decided to switch to munin for the graphing of system resources of our server infrastructure. Here is a step-by-step guide through the installation process.

Munin uses a client/server infrastructure (one "master" monitoring server polls the nodes for its configuration and values). All checks are executed on the nodes. In contrast, nagios allows you to execute checks on the monitoring server to check for remote server's functionality (e.g. "Is the webserver reachable from outside?").

The munin master creates a set of html files and images based on the performance data of the nodes. As long as the CGI graphing method is not used, no active components are required to browse this files. For a local installation (master and only one node) you can view the output by simply open the generated index.html page.

Installation of the munin master

On the master server, run emerge munin -av to install munin with all required dependencies (this will install the master part and the munin-node daemon). After installation, run emerge --config munin to install the crontab file(s) for the master.

The cronjob polls all configured clients every 5 minutes for its configuration and performance values.

The /etc/munin/munin.conf file controls the munin master. Open it in your favourite editor and add the local host as a node somewhere at the "a simple host tree" comment:

[host1.example.com]
    address 127.0.0.1

The cronjob now asks the host on 127.0.0.1 on the next run. You may get a mail from the cronjob stating that no checks are configured - you can ignore it for the moment.

Configuring the munin-node

Munin uses a very comfortable plug and play configuration for it's components. All checks are simple symlinks from /usr/libexec/munin/plugins/ to /etc/munin/plugins/. Munin ships with a helper script to set up common checks for the installed software on the nodes. Run sudo -u munin munin-node-configure --shell to get a copy and paste-friendly list of ln -s-commands. Munin comes with a pretty complete list of basic checks for commonly used software, so you should get a more or less complete set of checks for your running software. Execute the commands and start the munin-node (adding checks or changing check configurations requires a restart of munin-node). After the next run of the master's cronjob, a set of html files and graph images are created for the node. Make sure you let the graph job run twice to actually see data in your graphs.

Installing and configuring node 2-n

Until now, you should see the graph of your master node on http://localhost/munin/. To add more munin-node's, emerge munin with the minimal use flag on the nodes. After that, change the allow directive in /etc/munin/munin-node.conf to match the ip address of the munin master (and allow communication from the munin master to port 4949 on the node). Now follow the configuration steps above to add the checks for this node.