8.7. Resources Which Require Special Configuration for Monitoring

Some resources have to have specific configuration to be detected by JBoss ON discovery or to allow JBoss ON enough access to perform the full range of management.

8.7.1. Configuring Tomcat/EWS Servers for Monitoring

Tomcat servers are auto discovered on Linux and Unix platforms without any additional configuration. However, accurate Tomcat monitoring requires that the instance's JMX be configured to handle authentication appropriately.


For more information on configuring Tomcat, see the Tomcat documentation.
  1. Open the Tomcat/EWS instance's startup file. For example:
  2. Select an available port to use for authentication.
     JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=9876"
  3. Make sure that both authentication and SSL are disabled.
     JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
     JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"

8.7.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 1.3, 2.0, and 2.2 are supported on Red Hat Enterprise Linux. Only Apache 2.0 is supported on Windows.


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:
When compiling Apache from source, on 2.0.x versions, use the --enable-so option:
$ ./configure --enable-so
$ make install
For Apache 2.2.x versions, use the --enable-module=so option:
$ ./configure --enable-module=so
$ make install
  1. Download the Apache binaries from the JBoss ON UI.
    1. Log into the JBoss ON UI.
    2. In the Administration tab in the top menu, click the Downloads item.
    3. 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
  3. Each Apache version and platform has its own package that contains the Apache-SNMP connectors. Unzip 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.
    For example, on Red Hat Enterprise Linux 32-bit:
    cd apacheModuleRoot/apache-snmp/binaries/
    tar xjvf snmp_module-x86-linux-apache#.tar.bz2
    # is the Apache server version number.


    Apache connectors can be compiled for other platforms, like Solaris, from the source files in apacheRoot/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
    (To compile the Apache-SNMP connector, apxs, perl, make, and automake must all be installed and in user PATH.)
  4. Install the module:
    cd apacheModuleRoot/apache-snmp/binaries/snmp_module_#
    cp module/* apache_install_directory/modules
    cp conf/* apache_install_directory/conf
    mkdir apache_install_directory/var
  5. Open the httpd.conf file. For example, on Red Hat Enterprise Linux:
    vim apache_install_directory/conf/httpd.conf
  6. Add lines for the Apache server to load the SNMP module. The lines are similar, but not identical, between Apache versions.
    For Apache 1.3 on Red Hat Enterprise Linux:
    LoadModule  snmp_agt_module  modules/libsnmp_agt.so
    AddModule  covalent-snmp-v13.c
    SNMPConf  conf
    SNMPVar  var
    For Apache 2.0 and 2.2 on Red Hat Enterprise Linux:
    LoadModule snmpcommon_module modules/libsnmpcommon.so
    LoadModule snmpagt_module modules/libsnmpmonagt.so
    SNMPConf   conf
    SNMPVar    var
    For Apache 2.0 on Windows:
    xcopy /e JON_AGENT_INSTALL_DIR\product_connectors\apache-snmp\binaries\x86-winnt-apache2.0\* APACHE_2.0_INSTALL_DIR
  7. For Apache 2.0 and 2.2. Enable the module by adding these lines to the httpd.conf on both Red Hat Enterprise Linux and Windows:
    LoadModule snmpcommon_module modules/snmpcommon.so
    LoadModule snmpagt_module modules/snmpmonagt.so
    SNMPConf   conf
    SNMPVar    var
  8. 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
  9. To monitor more than one Apache instance on the same machine, make sure the agentaddress property in apache_install_directory/conf/snmpd.conf has a different value for each instance. See the snmpd.conf documentation for a description of this property's syntax.
  10. Restart the Apache server. For example:
    apache_installation_dir/bin/Apache -k restart
  11. 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')