If you need to use JVisualVM through a firewall and you only have access via SSH you do the following on Linux or OS X:
First create a SOCKS proxy on your local machine over SSH using the command "ssh -v -D NamServerIP:9696 ” You may need to add “-l loginName” if your login is different on the NAM box. It will prompt for your password.
Then run jvisualvm using the command line “jvisualvm -J-DsocksProxyHost=127.0.0.1 -J-DsocksProxyPort=9696"
Then add a JMX connection to :9010 using the credentials “adminRole” "adminPassword"
You will need to check the box that says don’t require SSL.