From 3ec6192fe46ef73e160a981ee65618672aebe112 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Oct 2025 14:06:36 -0700 Subject: [PATCH] improved read me --- .../Get Instance Info/README.md | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Server-Side Components/Background Scripts/Get Instance Info/README.md b/Server-Side Components/Background Scripts/Get Instance Info/README.md index f6a83c01b5..bd12eb2abd 100644 --- a/Server-Side Components/Background Scripts/Get Instance Info/README.md +++ b/Server-Side Components/Background Scripts/Get Instance Info/README.md @@ -1 +1,31 @@ -These are few scripts to run from Background Script editor to get the instance info. +A background script that retrieves and displays essential ServiceNow instance information including IP address, node ID, and instance name. + +## Usage + +1. Navigate to **System Definition → Scripts - Background** +2. Copy and paste the script content from `getInstanceInfo.js` +3. Click "Run script" +4. Check the system logs and info messages for the instance details + +## What It Does + +The script: +1. Retrieves the remote IP address of the current transaction using `GlideTransaction.get().getRemoteAddr()` +2. Gets the system/node ID using `GlideServlet.getSystemID()` +3. Fetches the instance name from system properties using `gs.getProperty("instance_name")` +4. Displays IP address and Node ID as info messages in the UI +5. Logs the instance name to the system logs + + +## Sample Output + +**Info Messages:** +``` +IP Address: 192.168.1.100 +Node ID: node1abc123def456 +``` + +**System Log:** +``` +*** Script: mycompany-dev +```