John  Frandsen
ServiceNow Employee
ServiceNow Employee

Attached to this article is a script include record 'ServiceMappingCIUtils' with 3 functions that allow the listing of CI Name(s) and associated IP Address(s) for all discovered application services (Service Maps).  

These functions list the CI's in a Service Map and include IP address(s), Manual Connections and/or Manual Endpoints when invoked from a scripts background window.  Manual Connections include the Parent & Child CI 'name' and 'ip_address'. See sample output below.

find_real_file.png

Note: <Bold/Red> removed for this example...

Example output for new ServiceMappingCIUtils().getAllInfo(); :
*** Script: <Name of Application Service> ******************
*** Script: CI Name: Ethernet0 IP_Address: 10.118.152.11
*** Script: CI Name: port-channel30 IP_Address: 10.253.1.170
*** Script: CI Name: Production IP_Address: 10.123.208.57
*** Script: CI Name: <CI name> IP_Address: (empty) ---This is Manual Endpoint---
*** Script: CI Name: <CI name> IP_Address: (empty) ---This is Manual Endpoint---

*** Script: ---This is Manual Connection---
*** Script: **** Parent CI:<CI name> IP_Address: 10.18.1.122
*** Script: **** Child CI: <CI name> IP_Address: 10.18.28.151

*** Script: CI Name: <CI name> IP_Address: 10.12.92.17
*** Script: CI Name: <CI name> IP_Address: 10.18.94.2
*** Script: IP_Address string of unique IP's/Service Map:
<List of 'comma separated' IP addresses that can be used as input to a 'Quick ranges' UI Action>
*** Script: <Name of Application Service>- Number of CIs with Unique IP Address: <calculated value>

Possible function calls:

new ServiceMappingCIUtils().getAllInfo();
All CI's details for all Discovered Application Services

new ServiceMappingCIUtils().getHardwareIPs();
Only CI Type Hardware CI's for all Discovered Application Services

new ServiceMappingCIUtils().getRangeSetIPs();
Only a list of CI IP Addresses formatted for 'Quick ranges UI Action' for all Discovered Application Services

All above function calls can be invoked to provide the same report for a single Discovered Application Service, i.e.
new ServiceMappingCIUtils().getAllInfo('Citrix');
new ServiceMappingCIUtils().getHardwareIPs('Citrix');
new ServiceMappingCIUtils().getRangeSetIPs('Citrix');

Which restricts all reporting to a single Discovered Application Service.

Install via
System Definition -> Script Includes -> Import XML -> Choose the attached xml file

Version history
Last update:
‎11-30-2020 07:59 AM
Updated by: