How to enable JMX port in Weblogic [10/11/12/14c] for monitoring

Every one have requirement to monitor the Weblogic performance in terms for Heap, GC, class loading ..etc during project development phase for performance stats /Load test results . As a part of this we will be seeing how we can enable JMX port in Weblogic and monitor each JVM for the details statics .

Please note there is some level of Monitoring available in Weblogic but that is instant value at that current point of time . We can not see the historical data for ex past 1 hour data . So enable JMX port on Weblogic and connect to Weblogic using tools like Jconsole,JVisualVM ,Java Machine control (JMC) using it core technology protocol . by having this we can do highly efficient performance tuning debugging tasks like flight recordings etc

Steps for enabling JMX is sam in Weblogic 10 ,11g ,12c, and 14c .

setDomainEnv.sh (or) setDomainEnv.cmd file can be found in the weblogic DOMAIN_HOME/bin directory to configure JVM arguments.

Unix – setDomainEnv.sh

JAVA_OPTIONS=”${JAVA_OPTIONS}
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false”
export JAVA_OPTIONS


Windows – setDomainEnv.cmd

set JAVA_OPTIONS=%JAVA_OPTIONS%
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Add the above in the respective files and restart Weblogic .

setDomainEnv file is global and the parameter . so the port which is configure can be usable by only one JVM which ever starts first and other will get port conflicts . So We need to add different port for each JVM for this . Port can be anything available on the server.

As per my Experience there will be custom script defined for each JVM so better Add the above given JVM arguments individually for each JVM so that which ever JVM you want to connect can easily connect .

In other way you can add in setDomanEnv file with an if condition for each of you JVM like below . In your case JVM name’s may be different .

JAVA_OPTIONS=”${JAVA_OPTIONS}”
export JAVA_OPTIONS

if [ “$SERVER_NAME” == “AdminSer” ]
then
JAVA_OPTIONS=”${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS

elif [ “$SERVER_NAME” == “AppSrv01” ]
then
JAVA_OPTIONS=”${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11112 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS
fi

use jconsole hostname:port to connect from jconsoe

or double click jvisualVM and connect using IP and PORT without credentials .

Above is an insecure way of connecting . If you want to try in Highr environments then better use below

-Dcom.sun.management.jmxremote.password.file=jmxremote.password
-Dcom.sun.management.jmxremote.authenticate=true
Here we have used the access configuration files named jmxremote.access and jmxremote.password

jmxremote.access file
# The "monitor" role has readonly access.
# The "admin" role has readwrite access.
monitor readonly
admin readwrite
jmxremote.password file
# specify actual password instead of the text password
monitor password
admin password

Hope this help!!!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *