Is there a way to monitor Apache 2.2.x (httpd) using SNMP or any other means to track the number of error responses (HTTP status codes 5xx)?
Thank you very much for your contact.
There are multiple approaches to monitor an Apache web server.
- You can enable SNMP on the machine running and monitor the Apache process directly using the "SNMP Library" sensor as describes here.
- Alternatively, and also recommend would be the HTTP sensor in addition to the process. The sensor monitors a web server using Hypertext Transfer Protocol (HTTP). This is the easiest way to monitor if a website (or a specific website element) is reachable.
In this case however please note that the monitored website is able to output different HTTP status codes to allow the sensor to work properly.
Thank you for your reply Sebastian, however none of these approaches fulfill my requirement. What I need is to track the number of HTTP errors that the Apache server serves over time. - Monitoring the Apache process via SNMP only provides stats on the process (status, process count, etc) - The HTTP sensor only monitors a particular URL
What I'm looking for would be similar to the WMI IIS sensor, tracking requests/s and errors/s only it would be for Apache rather than IIS.
Note: The WMI IIS sensor actually only reports "Not Found Errors"/s which equates to an HTTP status 404. If I could actually get "Errors"/s from either IIS or Apache I would be in business.
Thank you very much for the clarification.
Please have a look at the following information. Configure the mod_status properly which will allow you to monitor it via the HTTP Apache ModStatus PerfStats sensor. This might be an approach in the right direction but won't allow you to monitor the error stats precisely though.
They are per default not saved such as IIS does so this monitoring the HTTP response codes will be more complicated and will require a Custom Sensor. You need something such an apache_status web page that creates a json or xml output, which is able to be interpreted by the HTTP Advanced sensor correctly. This page should provide the totals for 2xx, 3xx, 4xx and 5xx replies for example.
Please note that we are not able to provide technical support for custom sensors.
Understood. I was hoping there would be an "out-of-the-box" approach, but you have confirmed for me that something custom would be needed. Thank you.