Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
Stuck thread count is always 0 even weblogic console show some stuck threads there

I'm using WebLogic 11g.I tried to get the stuck thread count of the servers by using a WSTL script. But it always give stuck thread count as 0 even WebLogic console show some stuck threads there. I have put the script below. Could you please help me to fix this issue. Thanks
## Prevent printing output to the screen
redirect('/dev/null','false')
## Insert your own password here
connect("weblogic","password", "t3://localhost:7001")
domainRuntime()
servers = ls('/ServerRuntimes','true','c')
# We'll store all results in here, using the server name for a key
result=dict()
for server in servers:
deployments = ls('/ServerRuntimes/' + server + '/ApplicationRuntimes','true','c')
result[server] = 0;
for deployment in deployments:
## If you are only interested in a single deployment, run that check here, like
## if(deployment.getName() == "MyApplication"):
## Could be that there are multiple workmanagers, I'm not sure, so let's iterate over them
wms = ls('/ServerRuntimes/' + server + '/ApplicationRuntimes/' \
+ deployment + '/WorkManagerRuntimes','true','c')
for wm in wms:
cd('/ServerRuntimes/' + server + '/ApplicationRuntimes/' \
+ deployment + '/WorkManagerRuntimes/' + wm)
result[server] = result[server] + get('StuckThreadCount')
## Reenable printing output
redirect('/dev/null','true')
## Print all server names and the number of stuck threads we counted per server
## Format for Nagios output etc. from here
for key in result:
print(key + " has " + str(result[key]) + " stuck threads.")