Shell script to take multiple thread dumps from multiple JVMs

Summary:

In Weblogic and Coherence, we often require thread dumps from all the nodes or servers when the issue happens.

Description:

For intermittent hung issues, we might need thread dump when Customer sees the issue and we want the thread dump from all the JVMs. The below script should help in that situation, we can provide the list process first and then just call the script.

#takeTd.sh

#take thread dumps for every 10 seconds for the listed PIDs

array=(10338,10389,10689)
len=${#array[*]}
echo “The array has $len members. They are:”
i=0
while [ 1 ]
do
while [ $i -lt $len ]; do
#echo ‘date “+%Y-%m-%d %H:%M:%S”‘
echo “PID $i: ${array[$i]}”
kill -3 ${array[$i]}
let i++
done
sleep 10
echo “starting next set of thread dumps”
i=0
done

Summary:

The above one should solve the basic need, will update the script if I come across any different use cases.

About sasikumarchellappan

Part of Sustaining Weblogic Development Team of Oracle Weblogic Server.
This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to Shell script to take multiple thread dumps from multiple JVMs

  1. Wikiconsole says:

    Good Post.. very useful.

    Thanks,
    http://www.wikiconsole.com

Leave a comment