Forum Stats

  • 3,872,506 Users
  • 2,266,435 Discussions


Stuck thread count is always 0 even weblogic console show some stuck threads there

User_LOA11 Member Posts: 2
edited Feb 17, 2021 6:05AM in WebLogic Portal

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



## Insert your own password here

connect("weblogic","password", "t3://localhost:7001")



servers = ls('/ServerRuntimes','true','c')


# We'll store all results in here, using the server name for a key


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



## 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.")