How to Install Munin on CEntOS

Munin is a monitoring tool for servers. It uses RRDtool to log and graph data from your servers. The plugin API is very easy to grasp. Actually, I haven’t read the API documentation yet. I just looked at the output of the plugins and it looks easy to achieve. The data can be accessed through the web.

This guide will walk you through installing and configuring Munin on CEntOS 4.3/4.4 x86. The steps are pretty much the same for later releases of CEntOS, Red Hat, Fedora [Core] and/or Red Hat-based installations.

Munin works by polling your servers for the data hence two applications, Munin and Munin Node. The former periodically gathers data (cronned) and the latter serves the data to the former. Please refer to the following for our example configuration. You can make up a domain if you want Munin to group your servers similar to the live demo.

Munin “Graph Server” – alpha.sample.net (192.168.1.1)
A Munin Node – bravo.sample.net (192.168.1.2)

1. Installing and Configuring Munin

In this section, we set it up on alpha.sample.net

  1. Add the RPMforge repository.
    rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
    This step is optional if your Linux distribution has the packages in its default repositories. For other versions and architectures, click here.
  2. Install munin.
    yum -y install munin

  3. Change the ownership of the Munin web docroot to munin.
    chown -R munin:munin /var/www/munin
  4. The default configuration file (in version 1.2.5-1) the value for the web docroot points to the wrong directory. Replace the value of htmldir from /var/www/html/munin to /var/www/munin at /etc/munin/munin.conf (line 7).
  5. Restart Apache and Cron
    service httpd restart && service crond restart
  6. You can check if it’s working through your browser (i.e. http://192.168.1.1/munin/). You will get a 404 (not found) if you don’t supply a trailing slash.

2. Add a Node

In this section, we will configure bravo.sample.net.

  1. Add the RPMforge repository (see 1.1).
  2. Install Munin Node.
    yum -y install munin-node
  3. Configure. Edit /etc/munin/munin-node.conf with your favorite text editor.
    • Allow the graph server (alpha.sample.net/192.168.1.1) to poll the node.
      allow ^192\.168\.1\.1$
    • If your server doesn’t report the correct hostname, add the following line
      host_name bravo.sample.net
    • If your servers have two interfaces and on the same LAN (e.g. one for Internet and another for LAN), you can configure the node to bind and listen on the local interface by changing the value of host (line 13) from * to the local IP of the node.
  4. Start munin-node and set to start on bootup.
    service munin-node start
    chkconfig munin-node on
  5. Edit Munin’s configuration on the graph server (/etc/munin/munin.conf).
    [bravo.sample.net]
    address 192.168.1.2
    use_node_name yes

Wait for at least 5 minutes for the new node to appear. You can also install the node on the graph server. The default node configuration will work out of the box.

3. Install/Activate Some Plugins

This section should familiarize you with the plugin installation routine. Plugins are installed in the nodes.

  • Apache
    1. Create a symbolic link to the Apache plugins (stored in /usr/share/munin/plugins) in the plugin folder.
      ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins/

    2. Enable server status reports. Add the following to Apache’s configuration file.
      ExtendedStatus On
      <Location /server-status>
      SetHandler server-status
      Order Deny,Allow
      Deny from all
      Allow from 127.0.0.1
      </Location>
    3. Restart Apache and the node
      service httpd restart && service munin-node restart
  • Asterisk
    1. Download the plugins for your Asterisk version from here.
    2. Extract them to /usr/share/munin/plugins.
    3. Make the files executable
      chmod 755 /usr/share/munin/plugins/asterisk_*

    4. Configure Asterisk Manager by adding/changing the following in /etc/asterisk/manager.conf
      [general]
      enabled = yes
      port = 5038

      [munin]
      secret = somepassword
      permit = 127.0.0.1 ;if this doesn't work, use the local IP
      write = system,call,log,verbose,command,agent,user

    5. Add the following to the plugin configuration file in /etc/munin/plugin-conf.d/munin-node
      [asterisk_*]
      env.username munin
      env.secret somepassword
    6. Reload Asterisk's configuration and restart the node.
      asterisk -rx reload >> /dev/null && service munin-node restart
  • MySQL
    1. Create a symbolic link to the MySQL plugins (stored in /usr/share/munin/plugins) in the plugin folder.
      ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins/
    2. If your root user has a password (or want to use a different user), edit the plugin configuration file in /etc/munin/plugin-conf.d/munin-node and uncomment line 16 by removing the leading hash (#). Then change the parameters that will be used when mysqladmin is run.
    3. Restart the node
      service munin-node restart
  • MTR
    1. Make sure you have the latest version of MTR.
      yum -y install mtr && yum -y update mtr
    2. Download the plugin here (direct link)
    3. Extract to /usr/share/munin/plugins
    4. Make the file executable.
      chmod 755 /usr/share/munin/plugins/mtr100_
    5. Create a symbolic link to the plugin (stored in /usr/share/munin/plugins) in the plugin folder. Append the host that you want to query to the link of the name.
      ln -s /usr/share/munin/plugins/mtr100_ /etc/munin/plugins/mtr100_somehost.com
    6. To add another host to query, just create another symbolic link.
    7. Add the following to the plugin configuration file in /etc/munin/plugin-conf.d/munin-node
      [mtr100_*]
      timeout 60
    8. Restart the node
      service munin-node restart

4. Links

  • http://www.time-synchronisation.co.uk/network-time-server-explaining-the-leap-second Tod Ocamb

    Thanks for this interesting information.

  • http://www.exclusiveeat.com Noreen Lemont

    Hi. I go through a few of one’s other posts and wished to understand in the event you would be interested in exchanging blogroll links?

  • http://www.bluelizardsunscreenreview.com Erasmo Feger

    Did you know that you can help yourself and your skin with great products. I have found out blue lizard the very best out there. Get the only convincing reviews on the net and know how you can shelter your skinn against harmfull sun x radiation.

  • http://www.wiiunlocker.com Wii Unlock

    Hi! Nice website. I always recommend wii unlock. Have a excellent day keep up the good work!

  • http://www.TheBestLegitOnlineJobs.com Online Jobs

    I Too Like the Blog here. Keep up all the work. I too love to blog. This is great everyone sharing opinions :)

  • http://www.utiffany.com Mazie Hysong

    Sterling silver jewelry that is worn continually often develops a lovely patina, a kind of glow combined with darkened areas. If you like the look, leave it alone. If you prefer a bright and shiny look for your sterling silver, use a polish cloth to restore the jewelry to its original appearance.

  • http://www.earthmagnets.net Earth Magnets

    I should write about this too.

  • http://www.kimkardashian.ca Kim Kardashian Sex Tape

    This sucks. Just my 2 cents.

  • http://www.elaneska.de/ gratisgeld

    Dont be lazy – Hard work spotlights the character of people: some turn up their sleeves, some turn up their noses, and some don’t turn up at all.

  • http://www.GAMBLINGGUIDE.CO Christopher Strutynski

    That is a wonderful point! Thanks for the insight. You might find our Gambling Directory of interest.

  • http://www.pandorapsp.net PSP Pandora Battery

    Can’t believe it.

  • http://www.klebebanddruck.de bedrucktes klebeband

    The new Zune browser is surprisingly good, but not as good as the iPod’s. It works well, but isn’t as fast as Safari, and has a clunkier interface. If you occasionally plan on using the web browser that’s not an issue, but if you’re planning to browse the web alot from your PMP then the iPod’s larger screen and better browser may be important.

  • http://www.jessica-alba.ca Louie Jebbett

    LOL

  • http://www.cpanel-hosting.info/cheap-cpanel-hosting/ Sheldon Leicht

    Following an agreement between J. Nick Koston and VDI, cPanel was only available to customers hosted directly at VDI. At the time there was little competition in the control panel market with the main choices being VDI and Alabanza.

  • http://www.pengeautomaten.dk/ LÃ¥n

    great post

  • http://www.nikejordanlink.com nike air max 2011

    nike
    air max 2011

    good position .Set different design,
    provide light, flexible, reduce supported using foam material heel sliding the
    whole palm MAX AIR mattress, provide excellent shock and wonderful smooth
    transition provides long-lasting traction features, I had bought feel this
    place too good nike
    air max 2011
    ialways go here to
    buy. Everyone get together and see this good place.

  • http://www.facebook.com/people/Daisy-Su/100000593308731 Daisy Su

    [url=http://www.go-replica.com/hermes-watches-16.html]hermes watches[/url]has brought to the world luxury items of distinction
     

  • Anonymous

    thanks for sharing

  • Nike0920

    thanks for sharing
    http://www.max2012.com

  • Nike2640
  • Weijieit

    https://www.gofavor.com/
    cheap Fashion Jewelry,Costume Jewelry,Jewelry Store,Fashion Jewelry

  • Anonymous

     Chinese reliable Baby and Kids wholesalers on viigoo.com with free shipping and worldwide delivery including fashion Baby and Kids Clothing,cheap Baby and Kids Diapering, discount Baby and Kidshref Feeding and more
    http://www.viigoo.com/

  • http://www.hp-notebookbattery.com Emily Wo

    That’s really a good post.

  • zzz

    Another possible way in which the phrase “international power cord” could be used could be in reference to a power cord for which one end is compatible with receptacles or a device from one country while the other end of the cord is compatible with receptacles or devices from another country. Such cords are actually somewhat common, and are especially popular among travelers who need to power their laptops while traveling.Dryer cords is important to note, however, hand lamps these cords are often not suited to converting voltage, which often differs between geographical locations, most notably between the United States and places like Europe or Africa. In such cases, a voltage converter is usually necessary to protect electronic devices from the difference in voltage. Outdoor extension cords are used in addition to international power cables, not as substitutes for them.
    The use of such international power cables is generally restricted to use with smaller appliances. After all, a traveler from the United States to Europe is not likely to bring his or her washing machine along for the trip. For this reason, international power cords are less often industrial utilities than they are consumer conveniences.

  • Youfriend

    very good

  • Pingback: Nike zapatos Mujer

  • sucre

    how do i access from web…..http://loalhost/munin, i cud see nothing…..please help

  • Pingback: Almeria