Skip to content

Instantly share code, notes, and snippets.

@dsmiley
Forked from philk/gist:1238525
Created May 3, 2012 06:20
Show Gist options
  • Save dsmiley/2583730 to your computer and use it in GitHub Desktop.
Save dsmiley/2583730 to your computer and use it in GitHub Desktop.
jconsole via socks proxy
function jc_remote {
jmx_host=$1
jmx_port=${2:-5000}
proxy_port=${3:-8123}
echo "Connecting jconsole to $jmx_host:$jmx_port via SOCKS proxy using local port $proxy_port"
ssh -ND $proxy_port $jmx_host &
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=${proxy_port} \
service:jmx:rmi:///jndi/rmi://localhost:${jmx_port}/jmxrmi
kill %1
#start remote java with:
#-Dcom.sun.management.jmxremote.port=5000
#-Dcom.sun.management.jmxremote.authenticate=false
#-Dcom.sun.management.jmxremote.ssl=false
}
@dsmiley
Copy link
Author

dsmiley commented Sep 30, 2014

TODO investigate com.sun.management.jmxremote.rmi.port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment