Author Archives: mharman

how to compile Apache 2.2 and openssl to support SNI on OpenSuse

With the later versions of Apache 2.2 it is possible to build a system which supports SNI (subject name indication). This allows you to host multiple ssl websites on the same ip address. It is effectively a version of host headers for ssl.

I found surprisingly little information on the internet as to how to get this to work, so I thought I would create this to show how it is done!

The installation was performed on a virtual machine running opensuse 11.1 32bit, however I would imagine other Linux/unix versions would be similar.

First the installation of opensuse installs openssl however this is not compiled with TLS support built in, so it has to be recompiled to allow us to continue.

So, first back up the existing openssl executable:

root> cp /usr/bin/openssl /usr/bin/openssl.orig

Now download the latest openssl source code from www.openssl.org and place it in /tmp. When I did this the version available was 1.0.0d, so the rest of the document will reference this version. Extract the tar file and install it with the following commands:
Continue reading

Creating an eventhandler in Nagios

This post is the final one in my series on Nagios. In the first one I wrote about what Nagios is, the second covered installation and the third covered writing custom check scripts (plugins).

Eventhandlers in Nagios are a means whereby you can get nagios to run scripts based upon something happening, for instance, should the apache (httpd) service be detected as failed, we can get nagios to run the commands to restart it. Thereby giving a timely response to a problem and not invoving the system administrators in the work.

This guide details the many steps required in order to configure this. The document will work through an example setup, whereby we are detecting apache (httpd) as being failed on host nagiosmonitored, we will then run the relevant command to resatrt it.

Before we begin it should be noted that the nagios system runs as the nagios user, therefore should privileged commands be required during the script steps, it will be necessary to grant the nagios user access to the root account, via sudo.
Continue reading

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