File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Server-Side Components/Background Scripts/Get Instance Info Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 1- These are few scripts to run from Background Script editor to get the instance info.
1+ A background script that retrieves and displays essential ServiceNow instance information including IP address, node ID, and instance name.
2+
3+ ## Usage
4+
5+ 1 . Navigate to ** System Definition → Scripts - Background**
6+ 2 . Copy and paste the script content from ` getInstanceInfo.js `
7+ 3 . Click "Run script"
8+ 4 . Check the system logs and info messages for the instance details
9+
10+ ## What It Does
11+
12+ The script:
13+ 1 . Retrieves the remote IP address of the current transaction using ` GlideTransaction.get().getRemoteAddr() `
14+ 2 . Gets the system/node ID using ` GlideServlet.getSystemID() `
15+ 3 . Fetches the instance name from system properties using ` gs.getProperty("instance_name") `
16+ 4 . Displays IP address and Node ID as info messages in the UI
17+ 5 . Logs the instance name to the system logs
18+
19+
20+ ## Sample Output
21+
22+ ** Info Messages:**
23+ ```
24+ IP Address: 192.168.1.100
25+ Node ID: node1abc123def456
26+ ```
27+
28+ ** System Log:**
29+ ```
30+ *** Script: mycompany-dev
31+ ```
You can’t perform that action at this time.
0 commit comments