{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1067,"path":"api-reference/server-api-reference/c_MonitorMIDServerAPI.md","title":"MonitorMIDServer - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# MonitorMIDServer- Global\n\nThe MonitorMIDServer script include provides methods to monitor MID Servers using the heartbeat probe to check for MID Servers that are down, sends heartbeat requests, and kills old heartbeat requests.\n\nUse this script include in a server script to monitor MID Servers.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## MonitorMIDServer - MonitorMIDServer\\(\\)\n\nCreates an instance of MonitorMIDServer.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n## MonitorMIDServer - killOldRequests\\(\\)\n\nIf there are any heartbeat probe requests that haven't been processed, cancels them so that they don't accumulate when a MID server is down for a while.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar mmsv = new MonitorMIDServer();\nmmsv.killOldRequests();\n```\n\n## MonitorMIDServer - markDowners\\(\\)\n\nMarks any non-responding MID servers as being down, by determining when the most recent heartbeat was sent and finding all non-responding servers.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar mmsv = new MonitorMIDServer();\nmmsv.markDowners();\n```\n\n## MonitorMIDServer - monitor\\(\\)\n\nPerforms the functions required for a scheduled MID server monitor cycle, including killing old requests, marking the MID servers that are down, and sending heartbeat requests to all servers.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar mmsv = new MonitorMIDServer();\nmmsv.monitor();\n```\n\n## MonitorMIDServer - sendHeartbeatRequests\\(\\)\n\nSends heartbeat requests to all MID servers and notes when by updating the server status record.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar mmsv = new MonitorMIDServer();\nmmsv.sendHeartbeatRequests();\n```\n\n"}}