Configuring the eG Agent to Report JVM-related Metrics for the WebLogic Server 9.0 (and above)

The eG agent can be optionally configured to execute a few additional tests on the JVM layer of the WebLogic monitoring model, so as to report critical statistics related to the WebLogic server’s JVM. These statistics typically reveal the following:

  • The count of classes loaded/unloaded (Java Classes test)
  • JVM thread usage (JVM Threads test)
  • CPU and memory usage of the JVM (JVM Cpu Usage test and JVM Memory Usage test)
  • The effectiveness of the JVM’s garbage collection activity  (JVM Garbage Collections test)
  • The uptime of the JVM (JVM Uptime test)
  • Whether JMX is currently enabled/disabled on the target WebLogic server (JMX Connection to JVM test)
  • The count and status of file descriptors (JVM File Descriptors test)

These additional tests are disabled by default for the WebLogic server.

These tests, if enabled, connect to the JRE used by the WebLogic application server to pull out the above-mentioned metrics. You can configure the eG agent to use either of the following methodologies for collecting the metrics of interest from the JRE:

  • JMX (Java Management Extensions)
  • SNMP (Simple Network Management Protocol)

This is why, while configuring each of these additional tests in the eG administrative interface, you are required to pick a monitoring MODE - i.e., either JMX or SNMP. The remaining test configuration depends upon the mode chosen.

Since both JMX and SNMP support are available for JRE 1.5 and above only, these additional tests should be enabled only if the WebLogic server being monitored runs JRE 1.5 and above.

Once the JRE version requirement is fulfilled, you must proceed to enable the JMX support for the JRE or SNMP support for the JRE, before enabling the optional tests. 

If you choose to use JMX for pulling out the desired metrics from the JRE, then the following broad steps need to be followed:

  • First, determine whether the JMX requires no authentication at all, or requires authentication (but no security)
  • If JMX does not require authentication, follow the steps below:

    1. Connect to the target WebLogic Application server and login to the WebLogic Administration Console. Once in the console, browse the Domain Structure tree in the left panel of the console for the Environment node. Expand the node and click the Server subnode within, as depicted by Step-1 of Figure 1 below. The Servers list in the right panel will then display all the WebLogic server instances that are currently available on the monitored WebLogic server. Click on that instance for which JMX is to be enabled, as depicted by Step-2 of Figure 1 below.

      1

      Figure 1 : Selecting the WebLogic server instance to be monitored

    2. When the Configuration-General tab page opens, click on the Server Start link, as shown by Step-3 of Figure 2, to start the chosen server instance.

      2

      Figure 2 : Starting the chosen WebLogic server instance

    3. Next, click on the Lock and Edit button in the left panel, as indicated by Step-4 in Figure 3 below, to edit the configuration of the server instance.

      3-jvmenabling

      Figure 3 : Editing the Arguments

    4. Then, in the right panel, edit the Arguments parameter indicated by Step-5 of Figure 3 above, as follows:

      -javaagent:-Dcom.sun.management.jmxremote.port=11222 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false

    5. Then, save the configuration changes by clicking on the Save button indicated by Step-6 in Figure 4 below.

      5

      Figure 4 : Saving the configuration changes

    6. In the left panel, click the Activate Changes button, as depicted by Step-7 of Figure 5.

      6

      Figure 5 : Activating the changes

    7. Next, click on the Control tab page (see Step-8) in the right panel of Figure 6.

      7

      Figure 6 : Clicking on the Control tab page

    8. From the list of server instances displayed in the right panel, select the server instance for which JMX has been enabled. Then, proceed to shutdown the instance. You can shutdown an instance immediately or schedule the shutdown to occur automatically when all the pending processing on the instance is complete. To choose the shutdown mode, click on the down arrow next to the Shutdown button and select the Force Shutdown Now or When Work Completes option (as the case may be), as shown by Step-9 of Figure 7

      8

      Figure 7 : Shutting down the instance

    9. Once the instance shuts down, click the Start button shown by Step-10 of Figure 8 to start the instance. If the State of the instance changes to running (as shown by Step-11), it clearly indicates that the instance has started.

      9

      Figure 8 : Starting the server instance

      10

      Figure 9 : State change indicating that the server instance has started

    10. If the JMX requires authentication (but no security), follow the steps below:

      • Login to the target WebLogic server. If the server is executing on a Windows host, then, login to the host as a local/domain administrator.
      • Next, copy the jmxremote.password.template file in the <JAVA_HOME>\jre\lib\management folder to any other location on the host, rename it as as jmxremote.password, and then, copy it back to the <JAVA_HOME>\jre\lib\management folder.
      • Next, edit the jmxremote.password file and the jmxremote.access file to create a user with read-write access to the JMX. To know how to create such a user, refer to Java Applications section.
      • Then, proceed to make the jmxremote.password file secure by granting a single user “full access” to that file. To know how to achieve this, refer to the Java Applications section.
      • Edit the management.properties file that is used by the JRE of the target WebLogic server, and configure the following in it:

        • The JMX remote port
        • Whether JMX is SSL-enabled or not
        • Whether JMX requires authentication or not
        • The full path to the jmxremote.access file
        • The full path to the jmxremote.password file

        To know how to configure these, refer to the Java Applications section.

      • Then, save the file.
      • Stop the WebLogic server.
      • Then, edit the <WEBLOGIC_HOME>\wlserver_10.0\samples\domains\wl_server\bin\StartWebLogic.bat file.
      • Add the following line in it:

        set JAVA_OPTIONS=-Dcom.sun.management.config.file=<<WEBLOGIC_HOME>>\jrockit_150_11\jre\lib\management\management.properties

      • Finally, start the WebLogic server.
      • Then, proceed to enable the JVM-related tests, and configure them using the instructions provided in the Monitoring Application Servers document. To enable one/more tests, go to the enable / disable tests page using the menu sequence : Agents -> Tests -> Enable/Disable, pick WebLogic as the Component type, Performance as the Test type, choose the tests from the disabled tests list, and click on the << button to move the tests to the ENABLED TESTS list. Finally, click the Update button.

Note:

To know how to enable SNMP support for the JRE, refer to the Java Applications section.