How to Monitor Apache With Nagios

By Kirk Bennet

Administrators can use Nagios to monitor Apache servers.
i Comstock/Comstock/Getty Images

If you need to monitor Apache Web servers and oversee their session status, consider using Nagios software. It can monitor servers that run on different platforms, such as Windows, Linux and AIX. Using Nagios, you can receive alerts when the Web server's client session limit is reached. You can also see the dropped user sessions that appear after the limit is reached. To monitor your servers with Nagios, you use the "mod_status" Apache module. It provides a static HTML page that contains the current server statistics in an easily readable form.

Step 1

Enable the relevant Apache server configuration settings. Open "/apache/httpd.conf" with any text editor and uncomment the following lines:

SetHandler server-status

Order deny,allow

Deny from all

Allow from

Enter your domain name instead of ""

Step 2

Open "apache/modules.conf" with any text editor and verify that the entry "LoadModule status_module /usr/lib/apache/1.3/" exists. If it does not, add it.

Step 3

Restart the server by using the "/init.d/apache restart" command. The module will not work without a restart, so this step is vital.

Step 4

Test that the "check_apachestatus" Nagios plugin is working. The command is "/local/nagios/libexec/ -H." Replace "-H" with the server's IP address.

Step 5

Monitor the Apache server by using the "check_apachestatus" plugin whenever you need to.