Updating the Java options according to the application server type


As part of the BMC Application Diagnostics Agent for Java installation process, you must add parameters to the application server’s JVM options. With this configuration, the Agent is displayed in the list of available Agents.

The process of updating Java options is different for each application server type. This topic provides instructions for some of the leading types of application servers:

Note

The BMC Application Diagnostics Agent for Java requires up to 256 MB of JVM heap memory. When the Agent is running in the same JVM memory space as the monitored applications, BMC recommends adding 256 MB to the Max heapsize Java options flag -Xmx.

Example

set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m

For full details about both the -javaagent and Xmx options, refer to the Java options for each application server type.

IBM WebSphere

You should configure WebSphere JVM options from the admin console; configuration should not be done from the start script.

  1. Log in to the WebSphere admin console.
  2. Expand Server Type and select WebSphere application servers.
  3. Click the name of the server to which you would like to attach the BMC Application Diagnostics Agent.
  4. Expand Java and Process Management and select Process Definition.
  5. Under the Additional Properties section, click Java Virtual Machine.
  6. Scroll down and locate the text box for Generic JVM arguments.
  7. Add the following lines: 

    • Windows

      -javaagent:<AgentInstallationDirectory>\ADOPsInstall\adops-agent.jar
      -Dcom.bmc.adops.agent.server.id="AppServer5"
    • Linux

      -javaagent:<AgentInstallationDirectory>/ADOPsInstall/adops-agent.jar -Dcom.bmc.adops.agent.server.id="AppServer5"

    Replace <AgentInstallationDirectory> with the location where the Agent is installed. The default folder is the one from which the installation script is run, for example:

    • Windows
      C:\bmc\adagent\ADOPsInstall\adops-agent.jar
    • Linux
      usr/bmc/adagent/ADOPsInstall/adops-agent.jar

    Note that the -Dcom.bmc.adops.agent.server.id parameter is automatically determined by the application server name. Add this line only if you want to customize the name.

  8. Save the configuration.
  9. Restart the WebSphere Application Server process.
     For further information about setting JVM arguments in WebSphere, see the IBM website.

Oracle WebLogic

  1. Edit the startWebLogic script.
    The file extension is cmd (Windows) or sh (Linux).
    This script is used when starting both admin and managed servers. The startManagedWebLogic script calls the startWebLogic script.
  2. Locate the JAVA_OPTIONS environment variable and add the following lines:

    • Windows

      set JAVA_OPTIONS=%JAVA_OPTIONS% -javaagent:<AgentInstallationDirectory>\ADOPsInstall\adops-agent.jar -Dcom.bmc.adops.agent.server.id="AppServer5"
    • Linux

      ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME}${JAVA_OPTIONS} -javaagent:<AgentInstallationDirectory>/ADOPsInstall/adops-agent.jar -Dcom.bmc.adops.agent.server.id="WebLogicServer3"  -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}

    Replace <AgentInstallationDirectory> with the location where the Agent is installed. The default folder is the one from which the installation script is run, for example:

    • Windows
      C:\bmc\adagent\ADOPsInstall\adops-agent.jar
    • Linux
      usr/bmc/adagent/ADOPsInstall/adops-agent.jar

    Note that the -Dcom.bmc.adops.agent.server.id parameter is automatically determined by the application server name. Add this line only if you want to customize the name.

  3. Restart the WebLogic Application Server process.
     For further information about specifying Java options for a WebLogic server instance, see the Oracle website.

Apache Tomcat

  1. Edit Tomcat’s catalina script.
    The file extension is bat (Windows) or sh (Linux).
  2. Locate the CATALINA_OPTS environment variable .
  3. Add the following lines:

    • Windows

      set CATALINA_OPTS=%CATALINA_OPTS% -javaagent:<AgentInstallationDirectory>\ADOPsInstall\adops-agent.jar -Dcom.bmc.adops.agent.server.id="AppServer5"
    • Linux

      CATALINA_OPTS=" -javaagent:<AgentInstallationDirectory>/ADOPsInstall/adops-agent.jar -Dcom.bmc.adops.agent.server.id="Tomcat6_2""

    Replace <AgentInstallationDirectory> with the location where the Agent is installed. The default folder is the one from which the installation script is run, for example:

    • Windows
      C:\bmc\adagent\ADOPsInstall\adops-agent.jar
    • Linux
      usr/bmc/adagent/ADOPsInstall/adops-agent.jar
  4. Restart the Apache Tomcat Application Server process.
     For further information about changing Java options when Tomcat runs as a Windows Service, see the Apache website.

JBoss

  1. Edit the JBoss run script.
    The file extension is cmd (Windows) or sh (Linux).
  2. Locate the JAVA_OPTS environment variable.
  3. Add the following lines:

    • Windows

      set JAVA_OPTS=%JAVA_OPTS% -javaagent:<AgentInstallationDirectory>\ADOPsInstall\adops-agent.jar -Dcom.bmc.adops.agent.server.id="AppServer5"
    • Linux

      JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -javaagent:<AgentInstallationDirectory>/ADOPsInstall/adops-agent.jar -Dcom.bmc.adops.agent.server.id=Jboss3"

    Replace <AgentInstallationDirectory> with the location where the Agent is installed. The default folder is the one from which the installation script is run, for example:

    • Windows
      C:\bmc\adagent\ADOPsInstall\adops-agent.jar
    • Linux
      usr/bmc/adagent/ADOPsInstall/adops-agent.jar
  4. Restart the JBoss Application Server process.
     For further information about updating both the JBoss run.conf file and run script, see the JBoss website.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*