jmxterm tool (command line tool)
Run the command line program :java -jar jmxterm-1.0.0-uber.jar
Useful args :
-l host:port to specify a remote jmx connection
-u foo -p pass to specify the jmx user/password
Commands :
Open a JMX session :
open
PID where PID is the PID of the JVM program that we want to connect to with JMX.
open
HOST PORT where HOST is the host and PORT is the JMX port where the app listens to.
List all JMX beans :
beans
List all domains:
domains
List methods of a JMX bean :
info -b BEAN_NAME
where BEAN_NAME is the name of the JMX Bean
————————————-
jconsole
Connect to JMX from JConsole : service:jmx:rmi:///jndi/rmi://192.168.59.99:9010/jmxrmi
jmx with spring boot
Run a spring boot 2 app with JVM from command line :
Different si on lance depuis Spring Boot 1 ou un JAR.
Replace « localhost » by the server ip/name if needed
—————————————————————-Dspring-boot.run.jvmArguments="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost"
Different si on lance depuis Spring Boot 1 ou un JAR.
Replace « localhost » by the server ip/name if needed
Unix
Find pid of a webapp on windows :netstat -ano | findstr 8080