Skip to content

Commit 690403d

Browse files
authored
Create README.md
1 parent bc7be8f commit 690403d

File tree

1 file changed

+26
-0
lines changed
  • Integration/Scripted REST Api/MID Server status JSON endpoint

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# MID Server status JSON endpoint
2+
3+
## What this solves
4+
Operations teams often need a quick machine-readable view of MID Server health for dashboards and monitors. This Scripted REST API returns a compact JSON array of MID Servers with their status, last update time, and a simple "stale" flag if the record has not changed recently.
5+
6+
## Where to use
7+
Create a Scripted REST API with a single Resource and paste this script as the Resource Script. Call it from monitoring tools, dashboards, or widgets.
8+
9+
## How it works
10+
- Queries `ecc_agent` for active MID Servers
11+
- Returns `name`, `status`, `sys_id`, `sys_updated_on`, and a computed `stale` boolean based on a configurable `minutes_stale` query parameter (default 15)
12+
- Uses `gs.dateDiff` to compute minutes since last update
13+
14+
## Configure
15+
- Pass `minutes_stale` as a query parameter to override the default, for example `...?minutes_stale=30`
16+
- Extend the payload as needed (for example add `version`, `ip_address`) if available in your instance
17+
18+
## References
19+
- Scripted REST APIs
20+
https://www.servicenow.com/docs/bundle/zurich-application-development/page/build/applications/task/create-scripted-rest-api.html
21+
- MID Server overview
22+
https://www.servicenow.com/docs/bundle/zurich-servicenow-platform/page/product/mid-server/concept/c_MIDServer.html
23+
- GlideRecord API
24+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideRecord/concept/c_GlideRecordAPI.html
25+
- GlideDateTime and dateDiff
26+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideDateTime/concept/c_GlideDateTimeAPI.html

0 commit comments

Comments
 (0)