How to Schedule a regular MID Server Thread Dump, to aid debugging stuck threadsIssue <!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } ul{ list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> Description It is possible that threads running in MID Servers get stuck, and then block other MID Server threads such as Probes or Patterns. To aid debugging, you can schedule a regular thread dump (jstack) of the MID Server application, to help understand what is blocked or waiting for what. Procedure Open a list of all MID Servers: In the navigation MID Server -> Servers. (ecc_agent table)Filter the list down to only the MID Servers(s) you want Thread Dumps for. e.g. Name Contains 'Disco'.Add an extra condition for Status IS Up, so that we only send new thread dump jobs to MID Servers that are running. (we need to avoid a backlog building up)Right click the blue filter line and 'Copy query'. This will give you the Encoded Query String for this list filter that we will use in the script. e.g. "nameLIKEdisco^status=Up"Open a new Scheduled Script record (sysauto_script): System Definition -> Scheduled Jobs, click New, click Automatically run a script of your choosing.Fill in Name: (custom) MID Servers Thread DumpFill in the schedule fields. e.g. Run: Periodically, Minutes: 10. Pick a time when no jobs are likely to be running in your MID Servers.Paste the following script into the Run this script field: // scheduled script to regularly do a MID Servers Thread Dump (KB0725067)var midGr = new GlideRecord('ecc_agent');midGr.addEncodedQuery('<query string goes here>'); // You may want additional conditions to limit which MID Servers are involved.midGr.query();while(midGr.next()) { var agent_name = midGr.name.replace(/'/g, "\\'"); var midmanage = new MIDServerManage(); midmanage.threaddump(agent_name); // This line writes the thread dump ecc_queue output to the mid server. gs.info('(custom) Running MID Server Thread Dump for MID Server: ' + agent_name);} Paste your query string copied earlier into the addEncodedQuery function highlighted above.Submit. The script will now run on the next scheduled time.To test this script, or run it on demand, use the Execute Now button.You can then Grab Logs for a MID Server to see the thread dumps in the wrapper.log file. Note: This will spam the MID Servers wrapper logs, which may have consequences for disk space, so be sure to deactivate this job once you have finished your debugging.