I have a Java process running on a remote machine, and the process sets up some mbeans. I also have jstatd
running on that machine as the same user as the Java proc
Unfortunately there is no way to assign random JMX port to the remote application. You can start your remote application with
-Dcom.sun.management.jmxremote.port=
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
and VisualVM will be able to read this configuration via Jvmstat (provide by jstatd) and open JMX connection to your remote application automatically. So you need to assign fixed port(s) to your remote application(s). Once you have it, everything will work fine and VisualVM will automatically connect to your application via JMX (in fact it will combine data from both Jvmstat and JMX).