Enabling Monitoring for Apache Servers

With Apache Web servers, you have the option of using the built-in status report functionality. This functionality requires that a mod_status module be built in, which is done by default.

  1. Click the ExtendedStatus On option button to view more detailed information.
  2. Add code to the configuration file access.conf to enable status reports only for browsers from the foo.com domain. The Apache configuration is maintained in a set of files typically located in /usr/local/apache/etc or /usr/local/apache/conf (Solaris) or /etc/httpd/conf (Linux).
  3. Add the following code to the main Apache configuration file, httpd.conf.
    <Location /server-status> SetHandler server-status
    order deny, allow deny from all allow from .foo.com
    </Location>
    If this code already exists but is commented out, un-comment it.
    Note: For monitoring to function appropriately, all allow statements must be correct.
  4. Restart your server.
  5. To verify the server's performance module, type the URL http://<hostname>/server-status?auto into your browser. Monitoring is enabled if you receive a response like the following message:
    Total Accesses: 210
    Total kBytes: 94
    CPULoad: .000278279
    Uptime: 366539
    ReqPerSec: .000572927
    BytesPerSec: .262608
    BytesPerReq: 458.362
    BusyServers: 1
    IdleServers: 6
    Scoreboard: ______W.................................................................................
    Note: The default Apache monitor works only if Telnet is enabled. To monitor an Apache server with Telnet disabled, use the WGet command instead of the default Rexec commands, as the following example shows.
    wget -q -O - http://<hostname>/server-status | grep
    "requests/sec" | cut -c5- | cut -d\ -f1