cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources tar xjvf ../binaries/snmp_module-x86-linux-apache<APACHE_VERSION>.tar.bz2
The RHQ apache plugin can auto-discover any Apache 2.x instances running on the 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.
Due to licensing issues, The SNMP connectors are available only with the JBoss Operations Network (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.
In order to use the SNMP module, the Apache server needs to have been compiled with shared object support (configure --enable-so).
Apache 2.2 is not supported on Windows.
Before building the modules under Solaris, refer to: http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Compiling_01 and http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Agent_39
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, where <APACHE_VERSION> is either "2.0" or "2.2":
for Linux-x86:
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources tar xjvf ../binaries/snmp_module-x86-linux-apache<APACHE_VERSION>.tar.bz2
for Linux-x64:
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources unzip ../binaries/snmp_module-x64-linux-apache<APACHE_VERSION>.zip
Otherwise, run the following commands to compile the module, where <APACHE_2.x_INSTALL_DIR> is the installation directory for the Apache server for which you are compiling the module, and <APACHE_VERSION> is either "2.0" or "2.2":
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources ./build_apache_snmp.sh <APACHE_VERSION> <APACHE_2.x_INSTALL_DIR>/bin/apxs
To avoid compile issues under Solaris, please refer to: http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Compiling_01 and http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Agent_39
The 2.0 module is provided in binary form for Windows and therefore no compilation is required.
cd <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/sources/snmp_module_<APACHE_VERSION> cp module/* <APACHE_2.x_INSTALL_DIR>/modules cp conf/* <APACHE_2.x_INSTALL_DIR>/conf mkdir <APACHE_2.x_INSTALL_DIR>/var chmod 777 <APACHE_2.x_INSTALL_DIR>/var
xcopy /e <JON_AGENT_INSTALL_DIR>\product_connectors\apache-snmp\binaries\x86-winnt-apache2.0\* <APACHE_2.0_INSTALL_DIR>
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_2.x_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_2.x_INSTALL_DIR>/conf/httpd.conf. At the end of the file, add the following lines:
LoadModule snmpcommon_module modules/libsnmpcommon.so LoadModule snmpagt_module modules/libsnmpmonagt.so SNMPConf conf SNMPVar var
Edit <APACHE_2.x_INSTALL_DIR>/conf/httpd.conf. At the end of the file, add the following lines:
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 a ServerName directive, which includes a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so please ensure that all ServerNames have unique values. For example:
ServerName main.example.com:80
...
<VirtualHost vhost1.example.com:80>
ServerName vhost1.example.com:80
...
</VirtualHost>
To restart Apache, run the following command:
<APACHE_2.x_INSTALL_DIR>/bin/apachectl restart
To restart Apache, run the following command:
<APACHE_2.0_INSTALL_DIR>\bin\Apache -k restart
To confirm that the SNMP module was installed successfully, run the following command:
grep SNMP <APACHE_2.x_INSTALL_DIR>/logs/error_log
Please also confirm that the output contains lines similar to the following:
[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')
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.
The same license restrictions applies, please read SNMP module notes above.
In order to use the RT module, the Apache server needs to have been compiled with shared object support (configure --enable-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 chmod +x build_apache_module.sh ./build_apache_module.sh 2.x <APACHE_2.x_INSTALL_DIR>/bin/apxs cp apache2.x/.libs/mod_rt.so <APACHE_2.x_INSTALL_DIR>/modules
Run the following command, where <APACHE_2.x_INSTALL_DIR> is the installation directory for the Apache server:
xcopy /e <JON_AGENT_INSTALL_DIR>\product_connectors\apache-rt\binaries\x86-winnt-apache2.0\* <APACHE_2.x_INSTALL_DIR>
At the very end of the httpd.conf file, add the following line:
LoadModule rt_module modules/mod_rt.so LogFormat "%S" rt_log
To configure RT logging for the "main" Apache server, add the following line somewhere at the top level of the file:
CustomLog logs/myhost.com80_rt.log rt_log
NOTE: The letter S inside the quotes must be in upper case.
To configure RT logging for a virtual host, add the following line somewhere within the VirtualHost block:
CustomLog logs/myhost.com8080_rt.log 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_2.x_INSTALL_DIR>/bin ./apachectl restart
To confirm that the RT module was installed successfully, check that the RT log files configured via the CustomLog directive now exist.