此内容没有您所选择的语言版本。
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:
Use the
--enable-module=so
option:
./configure --enable-module=so make install
$ ./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
https://server.example.com:7080
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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.zip
link to download the Apache connectors.
- Unzip the Apache connectors in a directory that is accessible to the JBoss ON agent.
unzip connector-apache.zip
unzip connector-apache.zip
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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:
cd apacheModuleRoot/apache-snmp/binaries/ tar xjvf snmp_module-x86-linux-apache#.tar.bz2
[jsmith@server ~]$ cd apacheModuleRoot/apache-snmp/binaries/ [jsmith@server binaries]$ tar xjvf snmp_module-x86-linux-apache#.tar.bz2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow # 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:cd JON_AGENT_INSTALL_DIR/product_connectors/apache-snmp/sources ./build_apache_snmp.sh APACHE_VERSION APACHE_2.x_INSTALL_DIR/bin/apxs
[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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To compile the Apache-SNMP connector,apxs
,perl
,make
, andautomake
must all be installed and in userPATH
. - Install the module. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:> xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86
> xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
httpd.conf
file for editing. For example:vim apache_install_directory/conf/httpd.conf
[root@server ~]# vim apache_install_directory/conf/httpd.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable the module by adding these lines to the
httpd.conf
file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For Windows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure the main Apache configuration section, as well as each
<VirtualHost>
configuration block, contains aServerName
directive with a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so eachServerName
directive must contain a unique value. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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.conf
file. Set theSNMPConf
directory in each file to its own SNMP configuration directory. For example, for instance1:vim instance1-httpd.conf SNMPConf /opt/apache-instance1/conf
vim instance1-httpd.conf SNMPConf /opt/apache-instance1/conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then, for instance2:vim instance2-httpd.conf SNMPConf /opt/apache-instance2/conf
vim instance2-httpd.conf SNMPConf /opt/apache-instance2/conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Eachsnmpd.conf
file should be in the specified directory. - Edit the
agentaddress
property in apache_install_directory/conf/snmpd.conf
so 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
apachectl -k restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow