Documentation forServer & Application Monitor

Configure Java application servers and JVMs for SAM monitoring

SAM includes several out-of-the-box templates that you can use to monitor Java application servers and Java Virtual Machines (JVMs) via:

The SAM templates include a predefined JMX Monitor that communicates with Java servers to poll available managed beans (MBeans) and return results. You can also use the Component Monitor Wizard to create a custom JMX Monitor to poll specific data from MBeans.

Note the following details about configuring Java application servers and JVMs:

See also

Oracle links in this topic are attributed to © 2020 Oracle, as obtained on January 9, 2020.

Configure a standalone Java application server or JVM for remote monitoring

Windows

  1. Download and install the Java Development Kit (JDK) you want to use:
  2. Add a JAVA_HOME variable to the system with its path pointing to the Java installation folder.
    1. On the Advanced tab of the System Properties dialog box for Windows, click Environment Variables.

    2. Edit the JAVA_HOME variable to point to where the JDK is located. For example, C:\Program Files\Java\jdk-14.0.1

  3. Navigate to the %JAVA_HOME%\jre\lib\management folder to configure authentication.
  4. If you want to use SNMP authentication:
    1. Rename the snmp.acl.template file to snmp.acl. Edit snmp.acl by replacing its content with:
      acl = {
      {
      communities = public, private
      access = read-only
      managers = localhost, orion-server
      }
      }
      Where orion-server is the hostname of the Orion server.
    2. Grant access to the snmp.acl file only for the Administrator.
  5. If you want to use JMX authentication:
    1. Rename the jmxremote.password.templatefile to jmxremote.password.
    2. Edit jmxremote.password by replacing/adding its content with the following: samuser somepasswd
      where samuser is the user for the monitored JVM and somepasswd is the password.
    3. Edit jmxremote.access by replacing/adding its content with the following: samuser readonly
      where samuser is user for the monitored JVM, provided with read only permission.
    4. Copy jmxremote.access and jmxremote.password to a folder, for example c:\jmxremote\.
    5. Grant access to the jmxremote.password file only for the Administrator.

Linux

  1. Download and install the JDK you want to use.
  2. Unpack and run Java SE. In this case, Java SE was installed in the /usr/java/jdk-14.0.1 folder.
  3. Move this folder to /usr/local.
  4. In the /usr/local/directory, create a symbolic link to jdk-14.0.1 named Java. Now Java SE is installed in /usr/local/jdk-14.0.1 and linked to /usr/local/java.
  5. Add the /usr/local/java/bin folder to the system path. (If it is only for your account, add it in .bash_profile file in your home directory). In Slackware, it should be in the .profile file. To make it a system-wide environment, add it in the /etc/profile.
  6. Edit a line in .bash_profile to be similar to: PATH=$PATH:$HOME/bin:/usr/local/java/bin. The path will be automatically set at boot time. To set the path immediately, use the following command: $ export PATH=$PATH:/usr/local/java/bin
  7. Add a variable to the system with the path pointing to the Java SE installation folder.
  8. Add the following lines to the /etc/profile file.

    Syntax dependencies may differ in various Linux distributions. This example is for a CentOS system.


    export JAVA_HOME=/usr/java/jdk-14.0.1
    export PATH=$PATH:/usr/java/jdk-14.0.1
  9. To set this immediately, run the export commands in your shell, or log out then log back into your system.
  10. If you want to use SNMP authentication:
    1. Go to the $JAVA_HOME/jre/lib/management folder and rename the snmp.acl.template file to snmp.acl.
    2. Edit snmp.acl by removing all lines and writing the following:
      acl = {
      {
      communities = public, private
      access = read-only
      managers = localhost, orion-server
      }
      }
      Where orion-server is the hostname of the Orion server.
    3. Grant access to the snmp.acl file only for the root user. Run the following commands as the root user in your shell:
      # chown root.root $JAVA_HOME/jre/lib/management/snmp.acl
      # chmod 600 $JAVA_HOME/jre/lib/management/snmp.acl
  11. If you want to use JMX authentication:
    1. Go to the $JAVA_HOME/jre/lib/management folder and rename the jmxremote.password.template file to jmxremote.password.
    2. Edit jmxremote.password by replacing/adding the content with the following:
      samuser somepasswd
      where samuser is the user for the JVM monitored from SAM and somepasswd is the password.
    3. Edit jmxremote.access by replacing/adding the content with the following:
      samuser readonly
      where samuser is user for the JVM monitored and readonly - gives this read only permissions.
    4. Copy jmxremote.access and jmxremote.password to a folder, for example /jmxremote/.
    5. Grant access to the jmxremote.password file only for the root user. Run the following commands as the root user in your shell:
      # chown root.root $JAVA_HOME/jre/lib/management/jmxremote.password
      # chmod 600 $JAVA_HOME/jre/lib/management/jmxremote.password

Test a standalone Java application server or JVM

To test that a target server can respond to SNMP queries, add the following command to the Java command line:

-Dcom.sun.management.snmp.port=1161 -Dcom.sun.management.snmp.interface=0.0.0.0

For example:

java -Dcom.sun.management.snmp.port=1161 -Dcom.sun.management.snmp.interface=0.0.0.0 some_java_applet

In another window/shell, run the following command to test SNMP and the Java SE configurations:

snmpwalk -v 2c -c public 127.0.0.1:1161 1.3.6.1.4.1.42.2.145.3.163.1.1.2.11

The command should return a value similar to:

SNMPv2-SMI::enterprises.42.2.145.3.163.1.1.2.11.0 = Counter64: 4803352

To test that a target server can respond to JMX queries, add the following command to the Java command line to enable JMX on port 8686 using authentication:

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password" -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access"

For example:

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password" -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access"some_java_applet

In a separate window/shell, run the following command to test JMX and the Java SE configurations:

%JAVA_HOME%\jdk1.7.0_3\bin\jconsole

In the jconsole window, select Remote Process, type 127.0.0.1:8686 and provide Username: sam and Password: somepasswd. After a successful connection, monitoring statistics should appear.

For reference, see Java arguments for remote JMX monitoring.

Configure JMX monitoring on WildFly servers

SolarWinds recommends using the Orion agent for Linux to monitor Wildfly (formerly JBoss) systems. This article describes how to configure the Orion server and target servers for JMX monitoring on Wildfly target servers.

JBoss is now known as Wildfly. To monitor Wildfly servers, SolarWinds recommends using the Orion agent for Linux. However, note that the JMX Bridge on the Orion server can be configured to monitor either WildFly or JBoss targets, but not both types simultaneously.

To support JMX monitoring on WildFly 13 or 16:

  1. Log into the Orion server.
  2. Use the Orion Service Manager to stop the SolarWinds JMX Bridge service.
  3. In File Explorer, navigate to the following default folder:

    C:\Program Files (x86)\SolarWinds\Orion\APM\jmxbridge\jsl\

  4. In a text editor such as Notepad, open the jsl64.ini file as an Administrator.
  5. Scroll to the param01 section of the jsl64.ini file, as shown here.

    param01 = %APM_HOME%\jmxbridge\SolarWinds.JMX.Bridge.jar;%APM_HOME%\jmxbridge\lib\log4j-1.2.16.jar;%APM_HOME%\jmxbridge\lib\wlclient.jar;%APM_HOME%\jmxbridge\lib\wljmxclient.jar;%APM_HOME%\jmxbridge\lib\WildFly-8.2\jboss-cli-client.jar

  6. Replace the existing code with the following code:

    param01 = %APM_HOME%\jmxbridge\SolarWinds.JMX.Bridge.jar;%APM_HOME%\jmxbridge\lib\log4j-1.2.16.jar;%APM_HOME%\jmxbridge\lib\wlclient.jar;%APM_HOME%\jmxbridge\lib\wljmxclient.jar;%APM_HOME%\jmxbridge\lib\javax.xml.soap-api.jar;%APM_HOME%\jmxbridge\lib\jaxb-api.jar;%APM_HOME%\jmxbridge\lib\jaxws-api.jar;%APM_HOME%\jmxbridge\lib\jsr181-api.jar.jar;%APM_HOME%\jmxbridge\lib\gmbal-api-only.jar;%APM_HOME%\jmxbridge\lib\ha-api.jar;%APM_HOME%\jmxbridge\lib\javax.activation-api.jar;%APM_HOME%\jmxbridge\lib\axb-core.jar;%APM_HOME%\jmxbridge\lib\jaxb-impl.jar;%APM_HOME%\jmxbridge\lib\jaxws-rt.jar;%APM_HOME%\jmxbridge\lib\management-api.jar;%APM_HOME%\jmxbridge\lib\mimepull.jar;%APM_HOME%\jmxbridge\lib\policy.jar;%APM_HOME%\jmxbridge\lib\saaj-impl.jar;%APM_HOME%\jmxbridge\lib\stax-ex.jar;%APM_HOME%\jmxbridge\lib\streambuffer.jar;%APM_HOME%\jmxbridge\lib\javax.annotation-api.jar;%APM_HOME%\jmxbridge\lib\WildFly-8.2\jboss-cli-client.jar

  7. Switch to the target server and follow these steps:
    1. In File Explorer, navigate to the WildFly 13/16 installation folder.
    2. Drill down to the /bin/client folder in the WildFly 13/16 installation folder.
    3. Copy the jboss-cli-client.jar file.
    4. Navigate to the following folder:
      C:\Program Files (x86)\SolarWinds\Orion\APM\jmxbridge\lib\WildFly-8.2
    5. Paste the jboss-cli-client.jar file into the folder.
  8. Start SolarWinds JMX Bridge service on the Orion server.

Configure a standalone Java application server or JVM for JBoss monitoring

The following information was created based on JBoss 6.1.

JBoss is now known as Wildfly. To monitor Wildfly servers, SolarWinds recommends using the Orion agent for Linux. However, note that the JMX Bridge on the Orion server can be configured to monitor either WildFly or JBoss targets, but not both types simultaneously.

Windows Service

  1. Edit %JBOSS_HOME%\bin\run.bat by adding the following lines, where %JBOSS_HOME% is the path to your JBoss installation:

    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"


    rem Setup JBoss specific properties
    set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"
  2. Register JBoss as a service by running: %JBOSS_HOME%\bin\service.bat -install
  3. Go to the Windows Services console
  4. Right-click the JBoss Application Server service.
  5. Click Properties.
  6. Switch to the Log On tab, and then click Log on as this account.
  7. Click Browse to locate the "Administrator" user, and then type the Administrator password twice.
  8. Click OK.
  9. Start the JBoss service.

Windows Command Line

  1. Navigate to the following section of %JBOSS_HOME%\bin\run.bat:
  2. Add the following lines immediately before the JBoss.Bootstrap.Environment section shown above, where %JBOSS_HOME% is the path to your JBoss installation and ###.###.#.### is the IP address of the JBoss server:
    set "JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
    set "JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver"
    set "JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=###.###.#.###"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=8686"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=true"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password""
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access""
  3. Start JBoss by running %JBOSS_HOME%\bin\run.bat.

Linux

Open $JBOSS_HOME/bin/run.sh and navigate to the following section:

# Display our environment
echo "========================================================================="
echo ""
echo "  JBoss Bootstrap Environment"
echo ""
echo "  JBOSS_HOME: $JBOSS_HOME"
echo ""
echo "  JAVA: $JAVA"
echo ""
echo "  JAVA_OPTS: $JAVA_OPTS"
echo ""
echo "  CLASSPATH: $JBOSS_CLASSPATH"
echo ""
echo "========================================================================="
echo ""

Add the following lines to $JBOSS_HOME/bin/run.sh immediately before the previous section, where $JBOSS_HOME$ is the path to your JBoss installation and where ###.###.#.### is the IP address of JBoss server:

JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=###.###.#.###"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=8686"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.password.file=" /jmxremote/jmxremote.password""
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.access.file=/jmxremote/jmxremote.access""

Start JBoss by running $JBOSS_HOME/bin/run.sh.

Configure a standalone Java application server or JVM for GlassFish monitoring

The following information was created based on Glassfish 3.1.

  1. Run the GlassFish Application Server.
  2. In a web browser, navigate to: http://hostname:4848 where hostname which is the name of your GlassFish server.
  3. In the left panel, click Configurations: server-config.
  4. In the main window, click JVM settings.
  5. Click the JVM Options tab.
  6. Use the Add JVM Option to enter the following values, one by one:
    • Dcom.sun.management.jmxremote
    • Djava.rmi.server.hostname=###.###.#.###, where ###.###.#.### is IP address of GlassFish server.
    • Dcom.sun.management.jmxremote.port=8686
    • Dcom.sun.management.jmxremote.ssl=false
    • Dcom.sun.management.jmxremote.authenticate=true
    • Dcom.sun.management.jmxremote.password.file="c:/jmxremote/jmxremote.password"
    • Dcom.sun.management.jmxremote.access.file=" c:/jmxremote/jmxremote.access"
  7. Click Save.
  8. Restart the GlassFish server.

Configure a standalone Java application server or JVM for IBM WebSphere monitoring

The following information was created based on IBM WebSphere 8.0. Note that WebSphere uses its own JDK, installed at %WEBSHERE_HOME%\java, where %WEBSHERE_HOME% is the path to your WebSphere installation.

  1. Run the IBM WebSphere Application Server.
  2. In a web browser, navigate to: https://hostname:9043 where hostname is the name of the WebSphere server.
  3. In the left panel, click Expand Servers and Server types.
  4. Click WebSphere Application Servers.
  5. In the main window, click your server.
  6. In the Server Infrastructure section, expand Java and Process Management.
  7. Click Process Definition.
  8. In the Additional Properties section, click Java Virtual Machine.
  9. In Generic JVM Arguments, add the following commands, where ###.###.#.### is the IP address of the WebSphere server:

    This command enables JMX monitoring without authentication.

    -Djavax.management.builder.initial= -Djava.rmi.server.hostname=###.###.#.### -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

  10. Save your changes.
  11. Restart the IBM WebSphere Application Server.

If errors occur, you can manually change/restore the configuration, as stored in the following file:

%WEBSPHERE_HOME%\profiles\your_profile\config\cells\your_cell\nodes\your_node\servers\your_server\server.xml

Configure a standalone Java application server or JVM for Oracle WebLogic monitoring

The following information was created based on Oracle WebLogic 8.0. Note that WebLogic uses its own JDK, installed at %MIDDLEWARE_HOME%\jdk*, where %MIDDLEWARE_HOME% is the path to your WebLogic installation.

Windows

Edit the following file:
%MIDDLEWARE_HOME%\user_projects\domains\<your_domain>\bin\startWebLogic.cmd,
where %MIDDLEWARE_HOME% is the path to your WebLogic installation. Add the following lines:

set "JAVA_OPTIONS=%JAVA_OPTIONS% -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.port=8686"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.ssl=false"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.authenticate=true"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password""
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.access.file=" c:\jmxremote\jmxremote.access""

The result should resemble this example:

…
call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.port=8686"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.ssl=false"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.authenticate=true"
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.password.file=" c:\jmxremote\jmxremote.password""
set "JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote.access.file=" c:\jmxremote\jmxremote.access""
set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%
…

This file is created by the Orion Configuration Wizard so any changes to this script will be lost the next time you use the wizard.

Restart the WebLogic Server.

Linux

Edit the following file:
$MIDDLEWARE_HOME/user_projects/domains/<your_domain>/bin/startWebLogic.sh,
where $MIDDLEWARE_HOME is the path to your WebLogic installation. Add the following lines:

JAVA_OPTIONS="$JAVA_OPTIONS-Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder"
JAVA_OPTIONS="$JAVA_OPTIONS -Dcom.sun.management.jmxremote"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.port=8686"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.authenticate=true"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.password.file="/jmxremote/jmxremote.password""
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.access.file="/jmxremote/jmxremote.access""

The result should resemble this example:

…
. ${DOMAIN_HOME}/bin/setDomainEnv.sh $*
JAVA_OPTIONS="$JAVA_OPTIONS-Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.port=8686"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.authenticate=true"
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.password.file="/jmxremote/jmxremote.password""
JAVA_OPTIONS="$JAVA_OPTIONS-Dcom.sun.management.jmxremote.access.file="/jmxremote/jmxremote.access""
SAVE_JAVA_OPTIONS="${JAVA_OPTIONS}"
…

This file is created by the Configuration Wizard. Your changes to this script will be lost the next time you use the configuration wizard.

Restart the WebLogic Server.

Configure a standalone Java application server or JVM for Apache Tomcat monitoring

The following information was created based on Apache Tomcat 7.0.

Windows Service

  1. Open the Tomcat configuration by clicking Start > All Programs > Apache Tomcat > Configure Tomcat.
  2. Open the Java tab, and add the following lines to the Java Options box:
    -Dcom.sun.management.snmp.port=1161
    -Dcom.sun.management.snmp.interface=0.0.0.0
  3. Click Apply.
  4. Go to the Windows Services console.
  5. Right-click the Apache Tomcat service.
  6. Click Properties.
  7. Click the Log On tab, and then click Log on as this account.
  8. Navigate to the Administrator user and type the Administrator password twice.
  9. Click OK.
  10. In the Tomcat Configuration window, return to the General tab, and then start the service.

Windows Command Line

  1. Open the file %TOMCAT_HOME%\bin\catalina.bat and add the following lines to the Debug, Run and Start sections, where %TOMCAT_HOME% is the path to your Tomcat installation:

    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"


    :doDebug
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"
    shift

    :doRun
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"
    shift

    :doStart
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.port=1161"
    set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.snmp.interface=0.0.0.0"
    shift
  2. Run %TOMCAT_HOME%\bin\startup.bat to start Tomcat.

Linux

  1. Open $TOMCAT_HOME/bin/catalina.sh and add the following lines into Debug, Run and Start sections, where %TOMCAT_HOME% is the path to your Tomcat installation:

    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1161"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=0.0.0.0"

    if [ "$1" = "debug" ] ; then
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1161"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=0.0.0.0"
    if $os400; then

    elif [ "$1" = "run" ]; then
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1161"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=0.0.0.0"
    shift

    elif [ "$1" = "start" ] ; then
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1161"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=0.0.0.0"
    if [ ! -z "$CATALINA_PID" ]; then
  2. Run $TOMCAT_HOME/bin/startup.sh command to start Tomcat.

Java arguments for remote JMX monitoring

The following table describes Java arguments that you can to enable remote JMX monitoring on standalone Java application server or JVMs:

Java argument Description
-Djava.rmi.server.hostname=###.###.#.### Indicates the IP address of the Remote Method Invocation (RMI) server.
-Dcom.sun.management.jmxremote Enables remote JMX monitoring.
-Dcom.sun.management.jmxremote.port=8686 Indicates which port the JMX module will use to accept JMX connections.
-Dcom.sun.management.jmxremote.ssl=false Indicates if SSL is used.
-Dcom.sun.management.jmxremote.authenticate=true Indicates if authentication is used (recommended).

If you're not using authentication, change the value to false.

-Dcom.sun.management.jmxremote.password.file=c:\jmxremote.password Indicates where the password file is stored.

Only add this line if you're using authentication.

-Dcom.sun.management.jmxremote.access.file=c:\jmxremote.access Indicates where the access file is stored.

Only add this line if you're using authentication.

To learn more about these arguments, see Java Documentation.

Additional resources