How to Monitor Apache With Nagios
By Kirk Bennet
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 .your_domain.com
Enter your domain name instead of "your_domain.com"
Step 2
Open "apache/modules.conf" with any text editor and verify that the entry "LoadModule status_module /usr/lib/apache/1.3/mod_status.so" 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/check_apachestatus.pl -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.
References
Tips
- You can see more detailed server statistics if you enable "ExtendedStatus." Simply add the line "ExtendedStatus on" in your "httpd.conf" file.
Writer Bio
Kirk Bennet started writing for websites and online publications in 2005. He covers topics in nutrition, health, gardening, home improvement and information technology.