이 콘텐츠는 선택한 언어로 제공되지 않습니다.

23.2. Configuring the Apache SNMP Module


To discover a Red Hat JBoss Web Server's virtual hosts and collect metrics for them, the SNMP module must be configured on that Red Hat JBoss Web Server.
Apache HTTP Server 2.2 is supported on Red Hat Enterprise Linux and Windows Server.
Important
To monitor Apache HTTP Server using JBoss ON, the SNMP module needs to be compiled prior to configuration following the instructions in Section 23.2.1, “Preparing the Apache SNMP module for use with Apache HTTP Server”.
The SNMP Plugin is already installed and enabled for JBoss ON 3.3, and the SNMP modules are pre-installed within Red Hat JBoss Web Server. To configure Red Hat JBoss Web Server for monitoring with JBoss ON:
  1. Open the httpd.conf file for editing.
    $ sudo vim JWS_install_directory/conf/httpd.conf
    
    Copy to Clipboard Toggle word wrap
  2. Enable the module by adding these lines to the httpd.conf file under the Dynamic Shared Object Support section.
    LoadModule snmpcommon_module JWS_install_directory/modules/snmpcommon.so
    LoadModule snmpagt_module JWS_install_directorymodules/snmpmonagt.so
    		
    SNMPConf   JWS_install_directory/conf
    SNMPVar    JWS_install_directory/var
    
    Copy to Clipboard Toggle word wrap
    For Windows Server:
    LoadModule snmpcommon_module modules/libsnmpcommon.so
    LoadModule snmpagt_module modules/libsnmpmonagt.so
    		
    SNMPConf   conf
    SNMPVar    var
    
    Copy to Clipboard Toggle word wrap
  3. Verify the main configuration section of the httpd.conf file, 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
  4. 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 web server instance has its own httpd.conf file. Set the SNMPConf directory in each file to its own SNMP configuration directory. For example, for instance1:
      $ sudo vim instance1-httpd.conf
      
      SNMPConf /opt/apache-instance1/conf
      Copy to Clipboard Toggle word wrap
      Then, for instance2:
      $ sudo 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 JWS_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.
  5. Restart Red Hat JBoss Web Server.
    $ sudo apachectl -k restart
    Copy to Clipboard Toggle word wrap
  6. Verify that the SNMP module is installed and configured by inspecting the Red Hat JBoss Web Server error log for notices regarding the SNMP module:
    $ grep SNMP JWS_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
The HTTP Server can now be added to the JBoss ON monitored resources using the JBoss ON User Interface by selecting the Inventory tab, followed by the Discovery Queue under the Resources menu.

23.2.1. Preparing the Apache SNMP module for use with Apache HTTP Server

If the SNMP connectors are required for supported versions of Apache HTTP Server (other than Red Hat JBoss Web Server 2.x), they need to be compiled from source and installed.
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 Red Hat JBoss Web Server servers, this is enabled by default.
To verify that the Apache HTTP 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:
$ sudo apachectl -l
						
	Compiled in modules:
		  core.c
		  prefork.c
		  http_core.c
		  mod_so.c
Copy to Clipboard Toggle word wrap
To compile Apache HTTP Server with shared object support, use the --enable-module=so option:
$ ./configure --enable-module=so
$ make install
Copy to Clipboard Toggle word wrap
  1. Apache connectors can be compiled for other platforms, like Solaris, from the source files in connector-apache.zip.
  2. Download the source files for the Apache modules 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.
    Note
    The zip file containing the source files for the SNMP module can be found at JON_SERVER_INSTALL_DIR/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/connectors/connector-apache.zip.
  3. To compile the SNMP modules, you need to have the following packages installed: perl, make, automake and libtool.
    sudo yum install perl make automake libtool
    Copy to Clipboard Toggle word wrap
    Additionally apxs should be present as part of your Apache installation.
  4. Unzip the Apache connectors and run the build script.
    $ sudo unzip connector-apache.zip
    $ sudo cd apache-snmp/sources/
    $ sudo chmod 755 ./build_apache_snmp.sh
    $ sudo ./build_apache_snmp.sh 2.0 [APACHE_INSTALL_DIR/sbin/apxs]
    
    Copy to Clipboard Toggle word wrap
  5. Install the module from the directory where build_apache_snmp.sh is located. For example:
    $ sudo cd snmp_module_#
    $ sudo cp module/* apache_install_directory/modules
    $ sudo cp conf/* apache_install_directory/conf
    $ sudo mkdir apache_install_directory/var
    Copy to Clipboard Toggle word wrap
    Where # is the Apache version (either 2.0 or 2.2)
    On Windows Server:
    > xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86
    Copy to Clipboard Toggle word wrap
  6. The Apache SNMP module is now ready to be configured using the same process as configuring the module for Red Hat JBoss Web Server, detailed in Section 23.2, “Configuring the Apache SNMP Module”.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat