-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6786 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
2. Setup an ssh pipe forwarding local port to ssh port on remote host via jump box.
$ # ssh –L local_port:remote_host_address:22 jumphost_address $ ssh –L 20000:10.229.10.144:22 artemis.corp.tnsi.com
3. Create a dynamic ssh tunnel which acts as a SOCKS proxy.
$ ssh -p 20000 -D 6786 localhost
4.
a. Configure Java VisualVM to use a SOCKS Proxy
i. select: Tools->Options->Network->Manual proxy settings
ii. Enter localhost and the port created in the dynamic port forward in step 3.
b. Add a remote host being the destination host running the java application
i. Right click Remote, select “Add Remote Host”
ii. Enter the address of the destination host
c. Next, right click destination remote host icon and select “Add JMX Connection”
i. Enter the address of destination host together with jmx registry port number
5. Connecting JConsole to the remote java application also requires directing it to the SOCKS proxy.
C:\Program Files\Java\jdk1.7.0_11\bin>jconsole.exe -J-DsocksProxyHost=proxy_host_address -J-DsocksProxyPort=proxy_port service:jmx:rmi:///jndi/rmi://localhost:jmxregistry_port/jmxrmi e.g. C:\Program Files\Java\jdk1.7.0_11\bin>jconsole.exe -J-DsocksProxyHost=localhost -J-DsocksProxyPort=6786 service:jmx:rmi:///jndi/rmi://localhost:6786/jmxrmi
Thanks to David O'Connor for figuring this out.