How to enable JMXRemote authentication and connect with JConsole
This tutorial will summarize how to setup a jmxremote access, so that a remote jconsole can be authenticated and connect. We will be inter...

We will be interested in 2 files, located in:
JAVA_HOME\jre\lib\management
- jmxremote.access
- jmxremote.password.template, rename to jmxremote.password
- Add an admin role in jmxremote.access, so at the end you should see:
monitorRole readonly admin readonly controlRole readwrite \ create javax.management.monitor.*,javax.management.timer.* \ unregister
- Then we need to add the role and password in jmxremote.password
monitorRole secret controlRole secret admin secret
cacls jmxremote.password /P:R cacls jmxremote.access /P :R
Then for example I'm interested to monitor JBoss with JConsole. And I have added JBoss in eclipse's server view. I need to add the following in Program Arguments:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false
Assumming I want to use port 9001.
Refer to the image below:
Finally run jconsole in command prompt, select org.jboss.xxx and enter our admin and password which is admin / secret.
Post a Comment