此内容没有您所选择的语言版本。

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
Copy to Clipboard Toggle word wrap
Use the --enable-module=so option:
$ ./configure --enable-module=so
$ make install
Copy to Clipboard Toggle word wrap
  1. Download the Apache binaries from the JBoss ON UI.
    1. Log into the JBoss ON UI.
      https://server.example.com:7080
      Copy to Clipboard Toggle word wrap
    2. Click the Administration tab in the top menu.
    3. In the Configuration menu box on the left, select the Downloads item.
    4. Scroll to Connector Downloads, and click the connector-apache.zip link to download the Apache connectors.
  2. Unzip the Apache connectors in a directory that is accessible to the JBoss ON agent.
    unzip connector-apache.zip
    Copy to Clipboard Toggle word wrap
  3. 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
    Copy to Clipboard Toggle word wrap
    # is the Apache server version number.

    Note

    Apache connectors can be compiled for other platforms, like Solaris, from the source files in apacheRoot/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
    Copy to Clipboard Toggle word wrap
    To compile the Apache-SNMP connector, apxs, perl, make, and automake must all be installed and in user PATH.
  4. 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
    Copy to Clipboard Toggle word wrap
    On Windows:
    > xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86
    Copy to Clipboard Toggle word wrap
  5. Open the httpd.conf file for editing. For example:
    [root@server ~]# vim apache_install_directory/conf/httpd.conf
    
    Copy to Clipboard Toggle word wrap
  6. Enable the module by adding these lines to the httpd.conf file.
    LoadModule snmpcommon_module modules/libsnmpcommon.so
    LoadModule snmpagt_module modules/libsnmpmonagt.so
    		
    SNMPConf   conf
    SNMPVar    var
    
    Copy to Clipboard Toggle word wrap
    For Windows:
    LoadModule snmpcommon_module modules/snmpcommon.so
    LoadModule snmpagt_module modules/snmpmonagt.so
    		
    SNMPConf   conf
    SNMPVar    var
    
    Copy to Clipboard Toggle word wrap
  7. Make sure the main Apache configuration section, as well as each <VirtualHost> configuration block, contains a ServerName directive with a port. The SNMP module uses this directive to uniquely identify the main server and each virtual host, so each ServerName directive must contain a unique value. For example:
    ServerName main.example.com:80
    ...
    		
    <VirtualHost vhost1.example.com:80>
    ServerName vhost1.example.com:80
    ...
    </VirtualHost>
    
    Copy to Clipboard Toggle word wrap
  8. If there is more than one Apache instance on the same machine, it is possible to use different SNMP files for each instance.
    1. Each Apache instance has its own httpd.conf file. Set the SNMPConf directory in each file to its own SNMP configuration directory. For example, for instance1:
      vim instance1-httpd.conf
      
      SNMPConf /opt/apache-instance1/conf
      Copy to Clipboard Toggle word wrap
      Then, for instance2:
      vim instance2-httpd.conf
      
      SNMPConf /opt/apache-instance2/conf
      Copy to Clipboard Toggle word wrap
      Each snmpd.conf file should be in the specified directory.
    2. 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.
  9. Restart the Apache server. For example:
    apachectl -k restart
    Copy to Clipboard Toggle word wrap
  10. 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')
    
    
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat