Get a thread dump from a Unix appserver

Version 1
    Share:|

    It can be useful to get a java thread dump from a running appserver for troubleshooting purposes.  This can be accomplished via the GUI and the Infrastructure Manager | Thread Info area of each appserver, or the Generate Support Data 'Appserver Status Report', but if the appserver is running but not responsive or you want to script the thread dump you can run something like this in a script.

     

     

    #!/bin/sh

    for ppid in $(ps -efw | grep br/blappserv | grep -v grep | awk '{print $2}')

        do

        for lpid in $(ps -efw | grep bladmin | grep ${ppid} | grep -v blappserv | grep -v grep | awk '{print $2}')

            do

            for apid in $(ps -efw | grep bladmin | grep ${lpid} | grep -v blappserv | grep -v grep | awk '{print $2}')

                do

                kill -3 ${apid}

            done

        done

    done

     

    Then check the 'console' log file(s) for the appserver deployment(s) running on the box.