You need to do following configuration to enable Remote JMX
monitoring on tomcat
server.
- Copy
jmxremote.password.template
located atJRE_HOME/lib/management
inside the same folder with the namejmxremote.password
. - Edit this
jmxremote.password
file, uncomment last two lines starts withmonitorRole
andcontroleRole
, instead of QED and R&D set some good password for both of them. - Change directory to
CATALINA_HOME/bin
from where you start the tomcat. - You will find
setenv.sh
(if you don’t find it create one) and add following line inside file
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=9000 -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.ssl=false"
- Here in above line you need to set proper ip address which is accessible from remote machine to
-Djava.rmi.server.hostname
and set available port number to-Dcom.sun.management.jmxremote.port
- Once all this settings are done
restart
/start
tomcat.
Above steps will enable remote JMX
on this JVM
. To monitor it using jconsole
from remote machine follow below steps from remote machine.
- Start
jconsole
$ jconsole
- Select Remote Process option and enter
<remote ip address>:<port>
, specify username asmonitorRole
orcontroleRole
and password that you set insidejmxremote.password
file for corresponding user.
This should start remote monitoring of remote JVM tomcat.