Show Table of Contents
23.2. Configuring the Apache SNMP Module
To discover an Apache server's virtual hosts and collect metrics for them, the SNMP module must be configured on that Apache server.
Apache 2.2 is supported on Red Hat Enterprise Linux and Windows platforms.
Important
To use the Response Time module, the Apache server needs to have been compiled with shared object support. For Red Hat Enterprise Linux systems and EWS servers, this is enabled by default.
To verify that the Apache server was compiled with shared object support, use the
apachectl -l command to list the compiled modules and look for the mod_so.c module:
[root@server ~]# apachectl -l Compiled in modules: core.c prefork.c http_core.c mod_so.c
Use the
--enable-module=so option:
$ ./configure --enable-module=so $ make install
- Download the Apache binaries from the JBoss ON UI.
- Log into the JBoss ON UI.
https://server.example.com:7080
- Click the Administration tab in the top menu.
- In the Configuration menu box on the left, select the item.

- Scroll to Connector Downloads, and click the
connector-apache.ziplink to download the Apache connectors.
- Unzip the Apache connectors in a directory that is accessible to the JBoss ON agent.
unzip connector-apache.zip
- Each Apache version and platform has its own package that contains the Apache-SNMP connectors. Extract the Apache connectors in a directory that is accessible to the JBoss ON agent. Binaries are available for Red Hat Enterprise Linux 32-bit and 64-bit and Windows 32-bit.For example, on Red Hat Enterprise Linux 32-bit:
[jsmith@server ~]$ cd apacheModuleRoot/apache-snmp/binaries/ [jsmith@server binaries]$ tar xjvf snmp_module-x86-linux-apache#.tar.bz2
# is the Apache server version number.Note
Apache connectors can be compiled for other platforms, like Solaris, from the source files inapacheRoot/apache-snmp/binaries/sources. For example:[jsmith@server ~]$ cd JON_AGENT_INSTALL_DIR/product_connectors/apache-snmp/sources [jsmith@server sources]$ ./build_apache_snmp.sh APACHE_VERSION APACHE_2.x_INSTALL_DIR/bin/apxs
To compile the Apache-SNMP connector,apxs,perl,make, andautomakemust all be installed and in userPATH. - Install the module. For example:
[root@server ~]# cd apacheModuleRoot/apache-snmp/binaries/snmp_module_# [root@server snmp_module]# cp module/* apache_install_directory/modules [root@server snmp_module]# cp conf/* apache_install_directory/conf [root@server snmp_module]# mkdir apache_install_directory/var
On Windows:> xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86
- Open the
httpd.conffile for editing. For example:[root@server ~]# vim apache_install_directory/conf/httpd.conf
- Enable the module by adding these lines to the
httpd.conffile.LoadModule snmpcommon_module modules/libsnmpcommon.so LoadModule snmpagt_module modules/libsnmpmonagt.so SNMPConf conf SNMPVar var
For Windows:LoadModule snmpcommon_module modules/snmpcommon.so LoadModule snmpagt_module modules/snmpmonagt.so SNMPConf conf SNMPVar var
- Make sure the main Apache configuration section, as well as each
<VirtualHost>configuration block, contains aServerNamedirective with a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so eachServerNamedirective must contain a unique value. For example:ServerName main.example.com:80 ... <VirtualHost vhost1.example.com:80> ServerName vhost1.example.com:80 ... </VirtualHost>
- If there is more than one Apache instance on the same machine, it is possible to use different SNMP files for each instance.
- Each Apache instance has its own
httpd.conffile. Set theSNMPConfdirectory in each file to its own SNMP configuration directory. For example, for instance1:vim instance1-httpd.conf SNMPConf /opt/apache-instance1/conf
Then, for instance2:vim instance2-httpd.conf SNMPConf /opt/apache-instance2/conf
Eachsnmpd.conffile should be in the specified directory. - Edit the
agentaddressproperty in apache_install_directory/conf/snmpd.confso that each instance has a different value agent address and port, so there is no conflict between instances.See the snmpd.conf documentation for a description of this property's syntax.
- Restart the Apache server. For example:
apachectl -k restart
- Verify that the SNMP module was properly installed. If the module is loaded, then there will be lines referencing the SNMP module in the errors log:
grep SNMP apache_installation_dir/logs/error_log [Wed Mar 19 09:54:34 2008] [notice] Apache/2.0.63 (Unix) CovalentSNMP/2.3.0 configured -- resuming normal operations [Wed Mar 19 09:54:35 2008] [notice] SNMP: CovalentSNMP/2.3.0 started (user '1000' - SNMP address '1610' - pid '26738')

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.