I am still not sure about what you are trying to acheieve through the scripts . If you looking for some shell script to take thread dump and capture any other information with that.
You can probably start with this script.
# Takes an argument (PID of the WLS process) and loops three times. This will append the top information to a file called dump_high_cpu.txt.
# The thread dump information will either be in file where stdout was redirected or printed on the screen.
for loopnum in 1 2 3
kill -3 $1
echo "cpu snapshot and thread dump done. #" $loopnum
echo "Done sleeping."
save this file as threaddump.sh
Please let me know if you are looking for any further information to be captured, we can probably modify the script to capture it.
You cannot have a automated script to run when there are stuck threads in your environment.
Well you'll have to closely observe the environment and issue the command below or run the script as suggested by Vishal Iyer in his last update.
The thread dump will be generated in Thread_Dump_AdminServer.txt
Note 1274713.1 addresses WLST thread dump in more details with examples on how to define sleep time between each dump and number of dumps to take.
Hope this helps!!
Thanks for the reply. We currently have a script to take thread dumps for closer observation. This script I have been working on is just to get targetted info. Here is a sample of our output we have been sending through email:
SERVER NAME : managed_server4
SERVER STATE : RUNNING
SERVER HEALTH STATE :HEALTH_WARN
SERVICE TIME : 128.91859468723223
AVERAGE SERVICE TIME : 61
ACTIVE SESSIONS : 7
Active Connection with dbDS (current/max) : 283/4000
Active Connection with pssdbDS (current/max) : 0/1200
Active Connection with txndbDS (current/max) : 0/600
I'm looking for a way to locate the user who is triggering the stuck thread state. I can see it through the weblogic console but I am unable to locate it from WLST.