-
-
Save dsmiley/2583730 to your computer and use it in GitHub Desktop.
jconsole via socks proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO investigate com.sun.management.jmxremote.rmi.port