I had been looking for a simple way to get a thread dump from JBoss to see what was happening on each of the SpatialKey servers without actually logging onto any of them. After all reading through thread dumps is one of my favorite past times. I found a simple way to do that writes an HTML file containing the thread dump and I can access it by hitting the webserver directory at a hidden URL.
The command is rather simple to generate a thread dump:
/jboss/bin/twiddle.sh invoke "jboss.system:type=ServerInfo" listThreadDump > /dump.html
I modified the /etc/crontab file to create this file every minute
*/1 * * * * root //jboss/bin/twiddle.sh invoke "jboss.system:type=ServerInfo" listThreadDump > /apachewebroot/subdir/dump.html 2>&1
It is pretty simple but it worked for what I needed.