โ‰ก Menu

Installing Munin on Centos 5

Have you ever wondered what your linux server was doing when you weren’t looking? Maybe it skipped off to eat a bagel, or stopped to play with a passing puppy… Perhaps you just want to see how much load you’re actually putting on the server, so that you can load it up even more, like some kind of digital pack mule… This is where Munin comes in. Munin is an open source system monitoring and graphing tool. Below, we are going to briefly cover the install of Munin on a CentOS 5 system (Munin is available on most Linux flavours, FreeBSD, Windows, OS X and other OS’s as well, making it perfect for monitoring multi platform environments).

Lets get rolling shall we?

1) First off, lets add the DAG repo for yum, so that we actually have an up to date version of Munin to install:
โ€ข using your favorite text editor, create the file: /etc/yum.repos.d/dag.repo
โ€ข inside this file, add the following:

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

2) Now that we have a repository containing munin, the install is simple. You can use yum to install it via the following command:

yum install munin munin-node

We need to install two parts for Munin to work properly. Munin it’s self handles the parsing of system info and generation of the pretty graphs. Munin-Node does the actual system monitoring. If you plan to install Munin on multiple systems and want to centralize all the graphing, you can skip the munin install and just put munin-node on the remote systems.

3) Now that it’s installed, you may wish to add/remove plugins to gather different information. Munin by default includes a directory of plugins in /usr/share/munin/plugins/.ย  To use any of these they are simply sym-linked to the munin plugin directory (which by default has a large number of these enabled.. Make sure you check out /etc/munin/plugins first to see if what you want is already there). For example, to add the apache monitoring plugins, you’d simply run the following command.

ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins

Note that some plugins may require special setup. For example the MySQL plugin requires access to the MySQL server, and the Apache plugins require system-status to be turned on in apache. There is plenty of good information on how to enable these properly by searching in google.

4) Now that you’ve installed Munin and your desired plugins, you need to start the munin-node to begin collecting data:

/etc/init.d/munin-node start

and you need to restart apache, to pickup the changes made there to display the graphs:

/etc/init.d/httpd restart

5) And you’re done! You’re stats should be visible at http://www.yoursite.com/munin/ keeping in mind that munin only adds data points to the graph every 5 minutes, so you may want to go get a coffee and come back before looking at your graphs. There are numerous configuration options available for munin, which again can be found on Google if needed.