Sohail Khilji
Kilo Patron
Kilo Patron

 

★ Subscribe for Daily Email Updates ★

╔═════ ☩ ══♛══ ☩ ═════╗

Short Knowledge Article Series No.3

╚═════ ☩ ══✦══ ☩ ═════╝

 

 

Auto/Schedule Restart of a MID Server - Script 

 

  • Does you mid server goes down very often ? 
  • Want to clear mid server recurring Stuck Threads, Memory leaks, Buffers or Handles ?

 

find_real_file.png

 

> Use the below script in schedule job to run on a scheduled time or use execute now to run it on demand...

var midGr = new GlideRecord('ecc_agent');
midGr.addEncodedQuery('status=Down'); // filter as needed
midGr.query();
while(midGr.next()) {
	var agent_name = midGr.name.replace(/'/g, "\\'");
	var midmanage = new MIDServerManage();
	midmanage.restartService(agent_name); 
	gs.info('Restarting MID Server: ' + agent_name);
}

 

< Next Post                                                Previous Post >  

 

▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂

Share | Subscribe | Helpful

 

 

           <<<  More Articles  >>>

  1. ServiceNow Integration with Splunk
  2. LDAP Integration with ServiceNow
  3. ServiceNow Integration with Veeam
  4. Handling ServiceNow flow errors with a flow
  5. Show parent child incident relationships - display in field message
  6. ServiceNow SSO Logout Error (redirects to logout page) – Reason, Fixes and Cause.
  7. Multi Row Variable set ServiceNow MRVS - Creating - Scripting - Example - Limits
  8. ServiceNow Integration with MAC vendor - Get Mac vendor for the given MAC Address.
  9. How to find Log4j vulnerable severs in ServiceNow Using CMDB Query Builder (SecOps) 
  10. How to Cancel a Long-Running Transaction ServiceNow
  11. Hidden Features for System Administrators

 

Thanks,

MF Sohail Khilji.

LinkedIn >   https://www.linkedin.com/in/mf-sohail-khilji/

 

 

 

Comments
Steve Phayre
Tera Contributor

If a MID server is "Down", then doesn't that mean that the instance can't communicate with it and therefore couldn't restart it?

Version history
Last update:
‎12-26-2021 07:55 PM
Updated by: