cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources tar xjvf ../binaries/snmp_module-x86-linux-apache1.3.tar.bz2
The RHQ apache plugin can auto-discover any Apache 1.3 instances running on an Agent machine. However, in order to collect traits or numeric metrics, the Apache SNMP module must be configured in the Apache instance; and, in order to collect HTTP response times, the Response Time (RT) module must be configured in the Apache instance.
In order to collect traits and metrics for an Apache Server and its virtual hosts, the SNMP module must be configured on that Apache server.
JON does not support monitoring of Apache 1.3 on Windows.
In order to use the SNMP module, the Apache server needs to have been compiled with shared object support (configure --enable-module=so).
Due to licensing issues, The SNMP connectors are available only with the JON product, which is built on RHQ. The Apache SNMP connectors can be downloaded from the JON GUI (starting with JON 2.2) by navigating to Administration->Downloads. In previous JON 2.x versions, the connectors were packaged with the agent distribution. Download and unzip in order to perform the steps below.
Perform the following steps to setup the SNMP module:
NOTE: In order to compile the SNMP module, apxs, perl, make, and automake must all be installed and in your PATH.
Binaries of the module are provided for Linux-x86 and Linux-x64. If you are running Apache on one of these platforms, extract these binaries as follows:
for Linux-x86:
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources tar xjvf ../binaries/snmp_module-x86-linux-apache1.3.tar.bz2
for Linux-x64:
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources unzip ../binaries/snmp_module-x64-linux-apache1.3.zip
Otherwise, run the following commands to compile the module, where <APACHE_1.3_INSTALL_DIR> is the installation directory for the Apache server for which you are compiling the module:
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources ./build_apache_snmp.sh 1.3 <APACHE_1.3_INSTALL_DIR>/bin/apxs cd snmp_module_1.3 cp module/* <APACHE_1.3_INSTALL_DIR>/libexec cp conf/* <APACHE_1.3_INSTALL_DIR>/conf mkdir <APACHE_1.3_INSTALL_DIR>/var chmod 777 <APACHE_1.3_INSTALL_DIR>/var
On versions of Linux (e.g. Ubuntu 6.10 and later) where /bin/sh is a symbolic link to /bin/dash, it is necessary to first run the following command in order for the build to complete successfully:
sudo ln -sf /bin/bash /bin/sh
For more information on why this is necessary, see http://en.wikipedia.org/wiki/Debian_Almquist_shell.
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources/snmp_module_1.3 cp module/* <APACHE_1.3_INSTALL_DIR>/libexec cp conf/* <APACHE_1.3_INSTALL_DIR>/conf mkdir <APACHE_1.3_INSTALL_DIR>/var chmod 777 <APACHE_1.3_INSTALL_DIR>/var
If you need to monitor more than one Apache instance on the same machine, you will need to make sure the agentaddress property in <APACHE_1.3_INSTALL_DIR>/conf/snmpd.conf has a different value for each instance. See the snmpd.conf manpage for a description of this property's syntax.
Edit <APACHE_1.3_INSTALL_DIR>/conf/httpd.conf. Somewhere before the MaxClients directive, add the following line:
LoadModule snmp_agt_module libexec/libsnmp_agt.so
If the file contains the ClearModuleList directive, add the following line after that directive:
AddModule covalent-snmp-v13.c
At the end of the file, add the following lines:
SNMPConf conf SNMPVar var
Make sure the "main" Apache configuration section, as well as each VirtualHost configuration block, contains a ServerName directive, which includes a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so make sure all ServerNames have unique values. For example:
ServerName main.example.com:80
...
<VirtualHost vhost1.example.com:80>
ServerName vhost1.example.com:80
...
</VirtualHost>
cd <APACHE_1.3_INSTALL_DIR>/bin ./apachectl restart
To confirm that the SNMP module was installed successfully, run the following command:
grep SNMP <APACHE_1.3_INSTALL_DIR>/logs/error_log
And confirm that the output contains lines similar to the following:
[Thu Mar 20 09:56:04 2008] [notice] SNMP: CovalentSNMP/1.2 started (user '1000' - address '1610' - pid '10924' snmpset 'enabled') [Thu Mar 20 09:56:04 2008] [notice] Apache/1.3.41 (Unix) CovalentSNMP/1.2 configured -- resuming normal operations
If the SNMP module fails to start, please refer to this FAQ entry to troubleshoot the issue.
In order to collect per-URL response time metrics for an Apache server, the Response Time (RT) module must be configured on that Apache server.
JON does not support monitoring of Apache 1.3 on Windows.
In order to use the RT module, the Apache server needs to have been compiled with shared object support (configure --enable-module=so).
Perform the following steps to setup the RT module:
NOTE: In order to compile the RT module, apxs must be installed, and make must be installed and in your PATH.
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-rt/sources ./build_apache_module.sh 1.3 <APACHE_1.3_INSTALL_DIR>/bin/apxs cp apache1.3/.libs/mod_rt.so <APACHE_1.3_INSTALL_DIR>/libexec
At the very end of the httpd.conf file, add the following line:
LoadModule rt_module libexec/mod_rt.so
To configure RT logging for the "main" Apache server, add the following line somewhere at the top level of the file:
RTLog logs/myhost.com80_rt.log
To configure RT logging for a virtual host, add the following line somewhere within the VirtualHost block:
RTLog logs/myhost.com8080_rt.log
Make sure the RT log file name is different for the main server and each virtual host. It is recommended that the host and port from the ServerName directive be used to form the file name as follows:
<host><port>_rt.log
Run the following command to restart Apache:
cd <APACHE_1.3_INSTALL_DIR>/bin ./apachectl restart
To confirm that the RT module was installed successfully, check that the RT log files configured via the RTLog directive now exist.