You are on page 1of 2

Linux Server Performance Monitoring with Munin

Posted by Dave on 17 May 2010, 11:55 pm

I often have the task of investigating server performance problems but have almost no
historical information on which to base any adjustments. Running ‘top’ to see what
process is using resources in the middle of an event may tell you what is happening right
then but that isn’t necessarily always the cause of the performance problems. In order to
make any informed decisions about your system’s configuration you need data. My
favorite tool for collecting performance data on single systems or small installations is
Munin.

Munin is comprised of two separate packages: ‘munin-node,’ which is a daemon that runs
on the system(s) to be monitored and ‘munin,’ which is a program that connects to the
munin-node daemon(s), collects the current performance information, stores and graphs it
using RRDTool, and then products HTML output [example]. On a typical installation you
would install both munin and munin-node on the same system. By default munin-node is
configured only to listen on localhost and munin is configured only to check for the
localhost node so little initial configuration is necessary.

Installing Munin on CentOS / RHEL:

Munin is not included in the CentOS / RHEL default repositories so you’ll need to add a
third-party repository to install it via yum. If you already have a third-party repo installed
and want to check if Munin is available, enter this command:

[user@host ~]$ yum list available munin munin-node

If it’s not available you’ll get “Error: No matching Packages to list”

At this point I’d recommend Installing the EPEL Repository but you can choose other
third-party repositories if you wish.

Once you have the proper repository installed, this is all you should have to do:

[user@host ~]$ sudo yum install munin munin-node

Installing Munin on Fedora:

Munin is included in the Fedora repositories so this is all you should have to do:

[user@host ~]$ sudo yum install munin munin-node

Installing Munin on Debian / Ubuntu:


Munin is included in most later Debian / Ubuntu repositories so this is all you should
have to do:

[user@host ~]$ sudo apt-get install munin munin-node

Post-Install Configuration

First, munin-node isn’t configured to automatically start at the default runlevels on


Fedora / CentOS / RHEL so you’ll need to do this if you want it to run on the next reboot:

[user@host ~]$ sudo chkconfig munin-node on

You can edit the /etc/munin/munin.conf to change the location to which it writes its
HTML output if you want to place this within the structure of an existing site. I usually
leave this set at the default and then just create a symlink or an Apache alias from the
website path to the Munin HTML directory.

All of Munin’s available plugins are located in /usr/share/munin/plugins/ Active plugins


will have a symlink back to the plugin located in /etc/munin/plugins/. Most of the plugins
you’d want are installed by default. Additional plugins that you may want to activate are
the ‘apache_*’ and ‘uptime’.

Once you’re done configuring your Munin node, start it:

[user@host ~]$ /etc/init.d/munin-node start

Munin has a cron job that runs every five minutes that connects to the node and collects
the data. You should start to see the graphs updating within about ten minutes. Once you
have a couple days of data you’ll be in a much better position to make decisions about the
system’s configuration.

You might also like