Ramblings From The Litter Tray of Life

Archive for April, 2010

Upgrading Nagios

Posted by graycat on 30 April 2010

For those of who have to look after multiple servers then you’ll understand the benefits of monitoring systems. In fact anything that will tell you of a problem before it becomes a major one has got to be a good thing!

Now whilst there’s many offerings out there in the market with solutions to fit every budget and requirements I’ve gone for Nagios. Nagios is an open source offering which really differs from others in the fact that it’s just the framework for the monitoring and you have to build or bolt on the checks on top. For me, this modular design is excellent as I know I’m starting with a blank slate and then adding only the bits I need.

Having have a Nagios box in place for well over a year now, I felt it was time to update the configuration into something a bit more manageable (covered in another post) but before I could do that I took the time to upgrade the application itself. It was an interesting process and one with a few tweaks from standard which may be applicable to others.

The upgrade of a vanilla install is pretty simple and covered here, however I’ll throw down a quick summary:

ssh onto the box and run as the local nagios account
su -l nagios

Remove the old HTML files that were being used by the gui frontend as they’re going to be upgraded.
rm /usr/local/nagios/share/{main,side,index}.html

Change into your downloads directory and download the latest source code of nagios
cd /downloads

Extract the tarball
tar xzf nagios-3.x.tar.gz
cd nagios-3.x

Run the confguration script with the name of the group used to control the external command file permissions
./configure –with-command-group=nagcmd

Compile the source code, install the updated binaries and web interface.
make all
make install

Verify the configuration files all work with this handy command:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Restart nagios service like thus:
/sbin/service nagios restart

Note: I found some of these stages more reliable to run as root rather than the nagios user.

At this point you’re pretty much done with the upgrade of a vanilla system. However, I use the Nuvola style to make Nagios that much easier on the eyes.

The Nuvola style sheet is pretty easy to install and tweak but does override some of the default web front end. Unfortunately when you upgrade Nagios it tramples all over these files so you have to rerun the install almost from scratch.

Posted in Applications, IT | Leave a Comment »