Apache

Version 2

    This template retrieves Apache server statistics from the built-in Apache server-status web page using Perl scripts.

     

    Prerequisites: Perl, access to the Apache server-status page.

    Credentials: SSH account on the web server.  

     

    Configuring Apache to allow access to the server-status page:  

    1. Log on to your Apache server using an SSH or telnet client.
    2. Grant yourself root permissions (su root).
    3. Locate the Apache configuration file, typically in /etc/httpd/conf/httpd.conf
      (For more information, see: http://wiki.apache.org/httpd/DistrosDefaultLayout)
    4. Append the following lines to your httpd.conf Apache configuration file, substituting the IP address or host name of your Apache server for localhost. Use localhost only if the Apache server services the loopback interface.

      <Location /server-status>
      SetHandler server-status
      Order Deny,Allow
      Deny from all
      Allow from localhost
      </Location>
      ExtendedStatus On

    1. Restart the Apache server (apachectl graceful).

    Note: Before using this template, the correct arguments should be set in all monitors.

    All monitors require the following arguments:  

    perl ${SCRIPT} server server_port  

    where

    server – This is the hostname or IP address of the target Apache server. You should set this argument to ${IP} which automatically replaces this argument with the target host IP address.

    server_port - This is the Apache port under which the site is running. By default it is set to port 80.

    Following is an example using the Scripts Arguments field:  

    perl ${SCRIPT} ${IP} 8080  

    Monitored Components:  

    ServerUptime

    This counter returns the time that the server has been up. Format of time: (days)d (hours)h (minutes)m (seconds)s

    .

    IdleWorkers

    This counter returns the number of free workers ready to handle client connections. This counter should be as high as possible.

    If you have no idle workers, or very few, Apache may be using all the processes it is allowed and new incoming requests must wait for older requests to finish before they can be handled. If this is the case, increasing the maximum allowed processes in your configuration file might help with performance.

     

    TotalAccess

    This counter returns the total number of accesses.

     

    TotalTraffic

    This counter returns the total number of kilobytes this server has served.

     

    ServerRequestPerSecond

    This counter returns the average rate of all requests per second.

    Note: The result is calculated as the total number of requests throughout the life of the server (count) and divided by the total uptime in seconds (up_time).

     

    ServerKbytesPerSec

    This counter returns the average rate of kilobytes served per second.

     

    ServerKbytesPerRequest

    This counter returns the average number of bytes per request.

     

    BusyWorkers

    This counter returns the number of busy workers serving requests. This counter should be as low as possible.

     

    Last updated: 11/11/2014