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...
https://www.czetsuyatech.com/2013/10/java-enable-jmx-remote-authentication.html
This tutorial will summarize how to setup a jmxremote access, so that a remote jconsole can be authenticated and connect.
We will be interested in 2 files, located in:
JAVA_HOME\jre\lib\management
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:
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.
We will be interested in 2 files, located in:
JAVA_HOME\jre\lib\management
- jmxremote.access
- jmxremote.password.template, rename to jmxremote.password
What needs to be done with these files:
- 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
Then we need to restrict the owner's right to read-only, right clicking on the file and clicking read-only won't do. Need to execute the lines below:
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