Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

3.3 3 Enable Monitoring

VERSION 1 
Created on: Oct 26, 2009 4:26 PM by Zenoss API - Last Modified:  Oct 26, 2009 4:26 PM by Zenoss API

#3.3. Enable Monitoring

#3.3.1. Display the Status Page in Apache Version 1.3 or higher

  1. On the Apache server, locate the httpd.conf file. Generally, this file is located at /etc/httpd/httpd.conf or /etc/httpd/conf/httpd.conf; however, other locations are possible depending on your operating system and setup.

    If you cannot locate the configuration file, use your system's search facilities to locate it. For Windows, use the Search button of the Windows Explorer tool. For Unix, try the following command:

    find / -name httpd.conf 
  2. Check to see that the following line is not commented out and is available in httpd.conf or /etc/apache/modules.conf:

    LoadModule status_module /usr/lib/apache/1.3/mod_status.so

    Note

    You may have to search in alternate locations to find the mod_status.so file. Also, the syntax may differ depending on your configuration.

  3. Turn the ExtendedStatus option on in the httpd.conf file. This option is typically commented out. You can enable it by uncommenting it or ensuring that it is defined.

    #ExtendedStatus on

    becomes:

    ExtendedStatus on
  4. Enable the /server-status location in the httpd.conf file. Typically, this option exists but is commented out.

    #<Location /server-status>
    #    SetHandler server-status
    #    Order deny,allow
    #    Deny from all
    #    Allow from .example.com
    #</Location>

    becomes:

    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from zenoss.example.com
    </Location>

    Note

    Your Zenoss server or servers must be able to connect to your Apache server. Ensure that it is listed here or is part of the network specified in this chunk of configuration.

    To specify multiple servers, separate the entries with spaces. If you specify an IP address range rather than a destination, be sure to add a network mask to the end of the IP address range.

    The following example allows a server called externalzenoss.example.com, as well as all servers that start with 192.168.10, in their addresses:

    <Location /server-status>SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from externalzenoss.example.com 192.168.10.0/24
    </Location>
    
  5. Save the httpd.conf file with these changes and verify that the configuration file is correct. This can be accomplished with following command.

    apachectl -t

    Correct any issues before restarting Apache.

  6. Restart the Web server (httpd). This can be accomplished with following command.

    apachectl restart

#3.3.2. Display the Status Page in Apache Version 2.x

  1. On the Apache server, find the httpd.conf file. This is usually /etc/apache2/apache2.conf or /etc/apache2/conf/httpd.conf; however, other locations are possible depending on your operating system and setup.

    If you are unsure about where your configuration file is located, use your system;s search facilities to locate this file. Under Windows, use the Search button of the Windows Explorer tool. Under Unix, try the following command:

    find / -name httpd.conf 
  2. Verify that the mod_status module is loaded.

     apache% apachec2ctl -M 2<&1 | grep status
    status_module (shared)
    

    The previous output indicates that the module is loaded and no further configuration is necessary. If there is no output, then copy the mods-available/status.load to the mods-enabled directory, and then run:

     apache% /etc/init.d/apache2 force-reload 
  3. Turn the ExtendedStatus option on in the httpd.conf file. This option is typically commented out. You can enable it by uncommenting it or ensuring that it is defined.

    #ExtendedStatus on

    becomes:

    ExtendedStatus on
  4. Enable the /server-status location in the httpd.conf file. This is another option that typically already exists but is commented out.

    #<Location /server-status>
    #    SetHandler server-status
    #    Order deny,allow
    #    Deny from all
    #    Allow from .example.com
    #</Location>

    becomes:

    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from zenoss.example.com
    </Location>

    Note

    Your Zenoss server or servers must be able to connect to your Apache server so you must ensure that it is either listed here or is a part of the network specified in this chunk of configuration.

    To specify multiple servers, separate the entries with spaces. If you would like to specify an IP address range rather than a destination, be sure to add a network mask to the end of the IP address range. The following example allows a server called externalzenoss.example.com as well as all servers that start with '192.168.10' in their addresses:

    <Location /server-status>SetHandler server-status
    Order deny,allowDeny from all
    Allow from externalzenoss.example.com 192.168.10.0/24
    </Location>
    
  5. Save the httpd.conf file with these changes and verify that the configuration file is correct. This can be accomplished with following command.

    apache2ctl -t

    Correct any issues before restarting Apache.

  6. Restart the webserver (httpd). This can be accomplished with following command.

    apache2ctl restart

#3.3.3. Verifying your Apache configuration

Once Apache has been configured, you should verify that it is working correctly. To verify your Apache server, point your Web browser to your Apache server at the appropriately modified URL:

http://your-apache-server/server-status?auto

This is an example of what you might see:

Total Accesses: 1
Total kBytes: 2
Uptime: 43
ReqPerSec: .0232558
BytesPerSec: 47.6279
BytesPerReq: 2048
BusyWorkers: 1
IdleWorkers: 5
Scoreboard: _W____................................

If there is a configuration issue, you should see an error message telling you that the page is forbidden.

Note

Your Zenoss server or servers must be able to connect to your Apache server by using HTTP to receive information. This means that the Zenoss server must be permitted not only by the Apache configuration settings, but also by any firewalls or proxies between the Zenoss server and the Apache server, including any firewall on the Apache server. If there are any proxies, they must be configured to allow the Zenoss HTTP traffic through to Zenoss. Consult your network administrator and security officer to verify the firewall configuration and your site's policies.

Further note that the name or IP address that your server has behind a firewall may be different than the IP address (some form of Network Address Translation (NAT)) or name resolution (the way that the external server resolves names may be through an Internet-visible DNS system rather than an intranet-only DNS system).

#3.3.4. Configure Zenoss to Monitor the Web Server

Once the Apache server is configured to allow Zenoss to access the extended status, you can add Apache monitoring to the device within Zenoss by simply binding the Apache template to the device.

  1. Navigate to the device in the Zenoss user interface.

  2. Click the page menu, and then select MoreTemplates.

  3. From the table menu select the Bind Templates... item to display the Bind Performance Templates dialog.

  4. To add the Apache template and retain other performance templates, hold down the control key while clicking on the Apache entry.

  5. Click OK.

    The Apache template should now be displayed under the Performance Templates for Device. You will now be able to start collecting the Apache server metrics from this device.

  6. Navigate to the Perf tab. You should see some placeholders for graphs (such as Apache - Requests, Apache - Throughput). After approximately fifteen minutes, you should see the graphs start to become populated with information.

Comments (0)