threadDump.pl - Print a thread dump of an JEE Server
threadDumpl.pl -f org.jmx4perl http://localhost:8080/j4p http-0.0.0.0-8080-1 (RUNNABLE): .... sun.management.ThreadImpl.dumpThreads0(ThreadImpl.java:unknown) org.jmx4perl.handler.ExecHandler.doHandleRequest(ExecHandler.java:77) org.jmx4perl.handler.RequestHandler.handleRequest(RequestHandler.java:89) org.jmx4perl.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:73) org.jmx4perl.AgentServlet.callRequestHandler(AgentServlet.java:205) org.jmx4perl.AgentServlet.handle(AgentServlet.java:152) org.jmx4perl.AgentServlet.doGet(AgentServlet.java:129) ....
For JEE Server running with Java 6, this simple script prints out a thread dump, possibly filtered by package name. This is done by executing the MBean java.lang:type=Threading's operation dumpAllThreads.
java.lang:type=Threading
dumpAllThreads
To install JMX::Jmx4Perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JMX::Jmx4Perl
CPAN shell
perl -MCPAN -e shell install JMX::Jmx4Perl
For more information on module installation, please visit the detailed CPAN module installation guide.