Skip to content

Instantly share code, notes, and snippets.

@eonnen
Created April 4, 2012 21:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eonnen/2305757 to your computer and use it in GitHub Desktop.
Save eonnen/2305757 to your computer and use it in GitHub Desktop.
SOCKS Tunnel Script for JConsole
#!/bin/bash
SOCKS_PORT=8081
SSH_TUNNEL_PORT=8080
SERVICE_JMX_PORT=8080
SERVICE_HOST=cassandra-0.prod
TUNNEL_HOST=admin-0.prod
ssh -f -D$SOCKS_PORT -L $SSH_TUNNEL_PORT:$SERVICE_HOST:$SERVICE_JMX_PORT $TUNNEL_HOST "while true; do sleep 10; done"
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=$SOCKS_PORT localhost:$SSH_TUNNEL_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment