The Java Management Extension JMX provides a standard interface to monitor the health, performance and resources of a Java Virtual Machine (JVM). JMX Monitoring is done in real-time by querying data from “Managed Beans” (MBeans) that are exposed via the JMX port. VisualVM JMX CPU profiling is a very powerful to detect performance bottlenecks and ispect the top consuming Java methods.
In this article, I will present how to enable JMX monitoring for IBM sterling Order Management OMS running on IBM Websphere Application Server.
IBM Websphere Application Server WAS:
- Login into WAS admin Console
- Click on Servers >> Server Types >> WebSphere application servers
- Click on the OMS server JVM from the list.
- Expand Java and Process Management under “Server Infrastructure” and click on Process definition
- Click on Java Virtual Machine under “Additional Properties”
- Enter following in “Generic JVM arguments” box
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9000 -Djava.rmi.server.hostname=77.77.77.164
Change the last two lines with your OMS Application Server IP and a free port on the server.
Apply the changes and restart the server. Verify that the port is listening with the netstat command.
Note: If your JVM is running inside a docker container use the container external IP in the hostname:
-Djava.rmi.server.hostname=[EXTERNAL_IP_OF_THE_DOCKER_CONTAINER]
Optional: you can also enable JMX on OMS Agent servers.
Enable JMX monitoring on OMS Agent Servers JVM:
• Go to OMSHome/ssfs/bin
• Make a copy of your agentserver.sh starting script :
[oms@myhost bin]$ cp agentserver.sh agentserverJMX.sh
• Add the following to the newly created file: change to match your IP address and a free port (should be different from the app server JMX port if both running on the same host) :
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=9099
-Djava.rmi.server.hostname=IP.ADD.RE.SS
Like this:
USE_AGENT_JAVA=1 export USE_JAVA_AGENT AGENT_JAVA_OPTS="-Dvendor=shell -DvendorFile=/home/oms/ssfs/properties/servers.properties -DCACHE_PS=true -DDISABLE_DS_EXTENSIONS=Y -Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9099 -Djava.rmi.server.hostname=9.26.137.xxx export AGENT_JAVA_OPTS"
• Start your agent with the newly created JMX script:
./agentserverJMX.sh DefaultServer
Now you are all set. You will be able to use VisualVM, JConsole or Java Mission Control JMC to monitor your OMS JVM(s). You will need to install JDK 8 or higher on your PC or install VisualVM or other JMX tools separately.
If you don’t have a JDK installed on your workstation, you can download VisualVM from this Github page.
Start jvisualvm from your JDK/bin folder
Start with adding the remote host/port configured earlier to VisualVM :
You can monitor the CPU usage, GC activity, heap memory, thread counts, classes…It is a very useful tool for load testing, peak testing, troubleshooting and debugging:
Powerful CPU sampling and profiling with VisualVM detects Top consuming methods:
To learn more about using VisualVM to monitor and debug Java applications in general, you can watch this short Youtube video here.
Leave a Reply