Sohail Khilji
Kilo Patron
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-26-2021 07:55 PM
★ 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 ?
> 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);
}
▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂
Share | Subscribe | Helpful
<<< More Articles >>>
- ServiceNow Integration with Splunk
- LDAP Integration with ServiceNow
- ServiceNow Integration with Veeam
- Handling ServiceNow flow errors with a flow
- Show parent child incident relationships - display in field message
- ServiceNow SSO Logout Error (redirects to logout page) – Reason, Fixes and Cause.
- Multi Row Variable set ServiceNow MRVS - Creating - Scripting - Example - Limits
- ServiceNow Integration with MAC vendor - Get Mac vendor for the given MAC Address.
- How to find Log4j vulnerable severs in ServiceNow Using CMDB Query Builder (SecOps)
- How to Cancel a Long-Running Transaction ServiceNow
- Hidden Features for System Administrators
Thanks,
MF Sohail Khilji.
LinkedIn > https://www.linkedin.com/in/mf-sohail-khilji/
- 3,953 Views
Comments
Steve Phayre
Tera Contributor
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
07-17-2023
06:58 PM
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?