Skip to content

Instantly share code, notes, and snippets.

@jcsalterego
Created August 7, 2012 13:14
Show Gist options
  • Save jcsalterego/3285239 to your computer and use it in GitHub Desktop.
Save jcsalterego/3285239 to your computer and use it in GitHub Desktop.
Run Remote Jstatd
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
#!/bin/bash
#
# Run jstatd Remotely
#
# * Requires jstatd.all.policy
# * Ensure your firewall is not blocking port 1099 tcp/udp
#
# Thanks to http://siniatech.com/blog/?p=263
BIND_DEV=eth0
BIND_HOST=$(ifconfig $BIND_DEV | awk '/inet /{print $2}' | awk -F: '{print $2}');
jstatd \
-J-Xdebug \
-J-Djava.security.policy=jstatd.all.policy \
-J-Djava.rmi.server.hostname=$BIND_HOST \
-J-Djava.rmi.server.logCalls=true \
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment