Oracle WebLogic (JMX)

Oracle WebLogic (JMX)

This template monitors for Oracle WebLogic server statistics by using the JMX protocol.

Prerequisites: Target server configured to allow JMX queries.

Note: This template is configured to send JMX requests on port 8686.

Credentials: Dependent upon JMX configuration.

This template was updated in SAM 2020.2. If you installed an earlier version of SAM, you can import this updated version. For the latest details about configuring Java application servers and JVMs for SAM monitoring, click here.

Configuring Java Virtual Machines for JMX

The SAM Java application Server (JMX) template allows you to monitor vital statistics from Java Virtual Machines (JVM). Before assigning the template to a node with a JVM you want to monitor, you must configure the target JVM to accept remote JMX queries.

The sections below discuss how to configure JVM servers for JMX monitoring JBoss. Configuration instructions are given for both Linux and Microsoft Windows operating systems.

·         Explaining Java arguments.

·         Configuring a Standalone Java Virtual Machine

·         Configuring Oracle WebLogic (tested on version 12)

 

Java Arguments

For enabling remote JMX monitoring, use the following Java arguments:

-Djava.rmi.server.hostname=192.168.0.236
This line indicates the IP address the RMI server will use. Enter your server IP address.

-Dcom.sun.management.jmxremote
This line enables remote JMX monitoring.

-Dcom.sun.management.jmxremote.port=8686
This line indicates which port the JMX module will use to accept JMX connections.

-Dcom.sun.management.jmxremote.ssl=false
This line indicates whether or not SSL is used.

-Dcom.sun.management.jmxremote.authenticate=true
This line indicates whether or not authentication is used. Authentication is recommended. If you do not want to use authentication, enter a value of false.

-Dcom.sun.management.jmxremote.password.file=c:\jmxremote.password
This line indicates where the passwords file is stored. Do not add this line if you do not use authentication.

-Dcom.sun.management.jmxremote.access.file=c:\jmxremote.access
This line indicates where the access file is stored. Do not add this line if you do not use authentication.

Additional information can be found at the following web page: http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html.

 

Configuring a Standalone Java Virtual Machine

 

Windows

1.   Download the JDK from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html(tested on JDK 1.7.0, update version 3).

2.   Install the JDK.

3.   On the license agreement page, read and accept the license and the click Next.

4.   Click Change to change the installation directory to C:\Program Files\Java\jdk1.7.0_3, and then click OK.

5.   Click Next.

6.   Click Finish to exit from the installer.

7.   Add a variable to the system with its path pointing to the JDK installation folder.

      For example:

Variable name: JAVA_HOME
Variable value:  C:\Program Files\Java\jdk1.7.0_3

Note: If you want to run Java commands from the command line, you should add the JDK installation path to the PATH variable.

If you use JMX authentication follow the steps 8-12.

8.   Navigate to the %JAVA_HOME%\jre\lib\management folder.

9.   Rename the jmxremote.password.templatefile to jmxremote.password. Edit jmxremote.passwordby replacing/adding its content with the following:

samuser somepasswd

Where samuser is the JVM user SAM will monitor and somepasswd is the user password.

10Edit jmxremote.accessby replacing/adding its content with the following:

samuser readonly

Where samuser is the JVM user SAM will monitor and readonly gives this user read only permissions.

11Copy jmxremote.access and jmxremote.password a some folder, for example c:\jmxremote\.

12Grant access to the jmxremote.passwordfile only for the Administrator. To grant access only for the Administrator, refer to the following instructions: http://download.oracle.com/javase/6/docs/technotes/guides/management/security-windows.html

 

Linux:

1.   Download the JDK from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html(tested on JDK SE 6, update version 24).

2.   Unpack and run the JDK. In this case, the JDK was installed into the /usr/java/jdk1.7.0_3 folder.

3.   Move this folder to /usr/local.

4.   In the /usr/local/directory, create a symbolic link to jdk1.7.0_3 named Java. Now the JDK is installed in /usr/local/jdk1.7.0_3and linked to /usr/local/java.

5.   Add the /usr/local/java/binfolder to the system path. (If it is only for your account, add it in .bash_profilefile in your home directory). In Slackware, it should be in the .profilefile. To make it a system wide environment, add it in the /etc/profile.

6.   Edit a line in .bash_profileto 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 command:
$ export PATH=$PATH:/usr/local/java/bin

7.   Add a variable to the system with the path pointing to the JDK installation folder.

8.   Add the following lines to the /etc/profile file. Syntax dependencies may be different in various Linux distributions. This example is shown for the CentOS system:

export JAVA_HOME=/usr/java/jdk1.7.0_3

export PATH=$PATH:/usr/java/jdk1.7.0_3

To set this immediately, run the export commands in your shell. Or, logout then log back in to your system.

If you use JMX authentication follow the steps 9-13.

9.   Go to the $JAVA_HOME/jre/lib/management folder and rename the jmxremote.password.template file to jmxremote.password.

10Edit jmxremote.passwordby replacing/adding its content with the following:

samuser somepasswd

Where samuser is the JVM user SAM will monitor and somepasswd is the password.

11. Edit jmxremote.access by replacing/adding its content with the following:

samuser readonly

Where samuser is the JVM user SAM will monitor and readonly gives this user read only permissions.

12Copy jmxremote.access and jmxremote.password to a folder, for example /jmxremote/.

13Grant 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

 

Testing a Standalone JVM

You can test that your JVM can respond to JMX queries by adding the following to the java command line. This will 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 JDK configurations:
%JAVA_HOME%\jdk1.7.0_3\bin\jconsole

In the jconsolewindow, select Remote Process, type 127.0.0.1:8686 and provide Username samand Password somepasswd.

After a successful connection, you will be able to see different monitoring statistics.

 

Configuring Oracle WebLogic (tested on version 12)

Windows

1.   Edit the following file:
%MIDDLEWARE_HOME%\user_projects\domains\<your_domain>\bin\startWebLogic.cmd

where %MIDDLEWARE_HOME%is the path to your WebLogic installation, by adding the 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:

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%


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

2.   Restart WebLogic Server.

Linux:

1.   Edit the following file:
$MIDDLEWARE_HOME/user_projects/domains/<your_domain>/bin/startWebLogic.sh

where $MIDDLEWARE_HOMEis the path to your WebLogic installation, by adding 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:

. ${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}"


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

2.   Restart the WebLogic Server.

 

Monitored Components

Note: All components may vary in a running environment. You can add your own threshold limits as needed. For more information, see http://knowledgebase.solarwinds.com/kb/questions/2415.

 

Classes Loaded Count

This monitor returns the number of classes that are currently loaded in the Java virtual machine.

 

Classes Total Loaded Count

This monitor returns the total number of classes that have been loaded since the Java virtual machine has started execution.

 

Classes Unloaded Count

This monitor returns the total number of classes unloaded since the Java virtual machine has started execution.

 

Memory Pending Final Count

This monitor returns the approximate number of objects for which finalization is pending.

 

Memory Heap Init Size (B)

This monitor returns the initial amount of memory in bytes that the Java virtual machine allocates; or -1 if undefined.

 

Memory Heap Used (B)

This monitor returns the amount of used memory in bytes. The amount of used memory in the returned memory usage is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.

 

Memory Heap Committed (B)

This monitor returns the amount of committed memory in bytes.

 

Memory Heap Max Size (B)

This monitor returns the maximum amount of memory in bytes that can be used; or -1 if undefined.

 

Memory Non Heap Init Size (B)

This monitor returns the initial amount of memory in bytes that the Java virtual machine allocates; or -1 if undefined.

 

Memory Non Heap Used (B)

This monitor returns the amount of used memory in bytes.

 

Memory Non Heap Committed (B)

This monitor returns the amount of committed memory in bytes.

 

Memory Non Heap Max Size (B)

This monitor returns the maximum amount of memory in bytes that can be used; or -1 if undefined.

 

Memory Garbage Collections Count

This monitor returns the approximate accumulated collection elapsed time in milliseconds.

 

Memory Garbage Collection Time (ms)

This monitor returns the approximate accumulated collection elapsed time in milliseconds.

 

Memory Pool Init Size (B)

This monitor returns the initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup. The Java virtual machine may request additional memory from the operating system and may also release memory to the system over time. The value of init may be undefined.

 

Memory Pool Used (B)

This monitor returns the amount of memory currently used (in bytes).

 

Memory Pool Committed Size (B)

This monitor returns the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. The amount of committed memory may change over time (increase or decrease). The Java virtual machine may release memory to the system and committed could be less than init. committed will always be greater than or equal to used.

 

Memory Pool Max Size (B)

This monitor returns the maximum amount of memory (in bytes) that can be used for memory management. Its value may be undefined. The maximum amount of memory may change over time if defined. The amount of used and committed memory will always be less than or equal to max if max is defined. A memory allocation may fail if it attempts to increase the used memory such that used > committed even if used <= max would still be true (for example, when the system is low on virtual memory).

 

Memory Pool Peak Used (B)

This monitor returns the peak amount of memory currently used (in bytes).

 

Memory Pool Peak Committed (B)

This monitor returns the peak amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. The amount of committed memory may change over time (increase or decrease). The Java virtual machine may release memory to the system and committed could be less than init. committed will always be greater than or equal to used.

 

Memory Pool Peak Max Size (B)

This monitor returns the maximum peak amount of memory (in bytes) that can be used for memory management. Its value may be undefined. The maximum amount of memory may change over time if defined. The amount of used and committed memory will always be less than or equal to max if max is defined. A memory allocation may fail if it attempts to increase the used memory such that used > committed even if used <= max would still be true (for example, when the system is low on virtual memory).

 

Threads Total Started Count

This monitor returns the total number of threads created and also started since the Java virtual machine started.

 

Current Thread Count

This monitor returns the current number of live threads including both daemon and non-daemon threads.

 

Current Thread Cpu Time

This monitor returns the total CPU time for the current thread in nanoseconds.

 

Current Thread User Time

This monitor returns the CPU time that the current thread has executed in user mode in nanoseconds.

 

Runtime Uptime (ms)

This monitor returns the uptime of the Java virtual machine in milliseconds.

 

Compiler Time (ms)

This monitor returns the approximate accumulated elapsed time (in milliseconds) spent in compilation.

 

JVM Runtime: Heap Free Current

This monitor returns the current amount of memory (in bytes) that is available in the JVM heap.

 

JVM Runtime: Heap Free Percent

This monitor returns the percentage of the maximum memory that is free.

 

JVM Runtime: Heap Size Current

This monitor returns the current size (in bytes) of the JVM heap.

 

JVM Runtime: Heap Size Max

This monitor returns the maximum free memory configured for this JVM.

 

JVM Runtime: Uptime

This monitor returns the number of milliseconds that the Virtual Machine has been running.

 

JTA Recovery Runtime: Initial Recovered Transactions

This monitor returns the total number of transactions that are recovered from the transaction log initially.

 

JTA Recovery Runtime: Recovered Transaction Completion Percent

This monitor returns the percentage of transactions that are recovered from the transaction log initially.

 

Server Security Runtime: Invalid Login Attempts

This monitor returns the total number of invalid logins that have been attempted on this server instance.

 

Server Security Runtime: Current Locked Users

This monitor returns the current number of locked users on this server instance.

 

Server Security Runtime: Login Attempts While Locked

This monitor returns the total number of invalid logins that have been attempted on this server instance while a user was locked.

 

Server Security Runtime: Unlocked Users

This monitor returns the total number of times a user of this server instance has been unlocked.

 

Server Security Runtime: User Lockout

This monitor returns the total number of user lockouts that have occurred on this server instance.

 

JTA Coordinator: Threads Constraint Runtime: Out Of Order Executions

This monitor returns the number of requests executed out of turn to satisfy this constraint.

 

JTA Coordinator: Threads Constraint Runtime: Current Wait Time

This monitor returns the last measured time a request had to wait for a thread. Only requests whose execution is needed to satisfy the constraint are considered.

 

JTA Coordinator: Threads Constraint Runtime: Executing Requests

This monitor returns the number of requests that are currently executing.

 

JTA Coordinator: Threads Constraint Runtime: Must Run

This monitor returns the number of requests that must be executed to satisfy the constraint.

 

JTA Coordinator: Threads Constraint Runtime: Pending Requests

This monitor returns the pending requests that are waiting for an available thread.

 

JTA Coordinator: Request Class: Pending Request

This monitor returns the number of requests waiting for a thread to become available. A request class represents a class of work. Work using the same request class shares the same priority.

 

JTA Coordinator: Work Manager: Pending Requests

This monitor returns the number of waiting requests in the queue of Work Manager.

 

JTA Runtime: Active Transactions

This monitor returns the number of active transactions on the server.

 

JTA Runtime: Total Transaction

This monitor returns the total number of transactions processed. This total includes all committed, rolled back, and heuristic transaction completions since the server was started.

 

JTA Runtime: Total Rolled Back Transactions

This monitor returns the number of transactions that were rolled back since the server was started.

 

User Lockout: Threads Constraint Runtime: Deferred Requests

This monitor returns the number of requests that are denied a thread for execution because the constraint is exceeded.

 

User Lockout: Threads Constraint Runtime: Executing Requests

This monitor returns the number of requests that are currently executing.

 

User Lockout: Work Manager: Pending Requests

This monitor returns the number of waiting requests in the queue.

 

User Lockout: Work Manager: Stuck Thread Count

This monitor returns the number of threads that are considered to be stuck on the basis of any stuck thread constraints.

 

WLS Admin Server: Allocated IO Buffer Bytes

This monitor returns the amount of off-heap (native) memory, in bytes, reserved for file store use.

 

WLS Admin Server: Allocated Window Buffer Bytes

This monitor returns the amount of off-heap (native) memory, in bytes, reserved for file store window buffer use.

 

WLS Admin Server: Object Count

This monitor returns the number of objects contained in the store.

 

Portions of this document were originally created by and are excerpted from the following sources:

Oracle Corporation, “Oracle WebLogic Server Documentation,” Copyright Copyright 2012 Oracle Corporation. 
All rights reserved. Available at http://docs.oracle.com/cd/E25054_01/apirefs.1111/e13952/pagehelp/Corecoreserverservermonitoringworkloadtitle.html

Parents Comment Children
No Data