Tag Archives: opensuse

Writing custom nagios check scripts (plugins)

This document is the third in my series on nagios. In the first one I discussed what Nagios is, the second one discussed the installation of nagios. This one will discuss writing custom check scripts (plugins). Finally a fourth is a howto on creating event handlers.

One of the beauties of Nagios, is that there is a large amount of freely available plugins available online, http://exchange.nagios.org/directory/Plugins

However in the unlikely event of you not being able to find what you require, it is quite easy to write your own custom plugins.

In the howto I will show you how to write a plugin to monitor the number of huge_pages in use on your system, so as to alert with a warning once a certain threshold is breached, followed by a critical alert once a higher threshold is reached. These thresholds will be passed into the script as parameters, so that you can re-use this plugin across multiple systems with differing threshold requirements.

First I will show you the whole script, and then afterwards explain its operation:
Continue reading

Nagios installation on OpenSuse

This is the second post in the series on Nagios. In the first post, I explained what Nagios is.

This post goes through the installation and initial configuration. The third post in the series covers writing custom monitoring scripts; Finally a fourth post covers creating event handlers.

So here goes with the installation and configuration!

Before installing nagios we need to make sure the server has the following prerequisite packages installed:

C/C++ development libraries
php5
apache2
apache2-mod_php5

Download Nagios from www.nagios.org/download

Click on the Get Nagios Core link

Download the latest stable release as a .tar.gz file and place it on the server, in a suitable directory, e.g. /tmp

For the purposes of this guide, I will download version 3.3.1

NOTE: The rest of the installation will continue as the root user.

Extract the file:

#> cd /tmp
#> tar -xvzf nagios-3.3.1.tar.gz

Enter the nagios directory:

#> cd nagios

Create a nagios user:
Continue reading