23.2. Configuring the Apache SNMP Module

download PDF
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.
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
  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/
    LoadModule snmpagt_module JWS_install_directorymodules/
    SNMPConf   JWS_install_directory/conf
    SNMPVar    JWS_install_directory/var
    For Windows Server:
    LoadModule snmpcommon_module modules/
    LoadModule snmpagt_module modules/
    SNMPConf   conf
    SNMPVar    var
  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:
  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
      Then, for instance2:
      $ sudo vim instance2-httpd.conf
      SNMPConf /opt/apache-instance2/conf
      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
  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')
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.
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:
To compile Apache HTTP Server with shared object support, use the --enable-module=so option:
$ ./configure --enable-module=so
$ make install
  1. Apache connectors can be compiled for other platforms, like Solaris, from the source files in
  2. Download the source files for the Apache modules from the JBoss ON UI.
    1. Log into the JBoss ON UI.
    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 link to download the Apache connectors.
    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/
  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
    Additionally apxs should be present as part of your Apache installation.
  4. Unzip the Apache connectors and run the build script.
    $ sudo unzip
    $ sudo cd apache-snmp/sources/
    $ sudo chmod 755 ./
    $ sudo ./ 2.0 [APACHE_INSTALL_DIR/sbin/apxs]
  5. Install the module from the directory where 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
    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
  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


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.