- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2022 02:54 PM
I'm developing a Service Graph Connector that uses a Custom (Load by Script) Data Source to pull asset information from an Elasticsearch server and create/update Configuration Items in ServiceNow.
My Data Source inserts de-normalized asset information into an Import Set table. An "asset" represents a Configuration Item (Linux Server, Windows Server, Computer, etc...) and has multiple IP and MAC addresses. Unfortunately those data points aren't linked, so I have no way of knowing which IP Addresses belongs to specific Network Adapters.
I've noticed that IP Addresses linked to a Configuration Item that do not reference a Network Adapter (via Nic field) don't appear under the "CI IPs" tab when looking at a Configuration Item. This KB article shows a solution, which is to specify the correct "Nic" reference: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0722911.
To resolve this, I tried creating a "dummy" Network Adapter who's sole purpose is to act as a bridge between the CI and IP Address. My Data Source script handles this association by doing the following:
- For every IP address listed on the asset, generate a GUID via gs.generateGUID()
- Insert a record into the Import Set table for a Network Adapter and include that GUID in the "NIC ID" field. Also set the IP Address field of the Network Adapter.
- Insert a record into the Import Set table for an IP Address and include that same GUID.
The "NIC ID" field will then be used in IntegrationHub mappings as the "Source Native Key" for the Network Adapter and also as the reference value for the "Nic" field in the IP Address mappings. I've also set up relationships so that my Linux Server owns both the Network Adapter and IP Address CIs.
Here's a sample table showing the de-normalized data in an Import Set table:
ID | Name | Serial Number | Type | IP addr | NIC ID |
12345 | My Server | 123-456-789 | linux_server | ||
12345 | My Server | 123-456-789 | network_adapter | 10.2.96.128 | abc123 |
12345 | My Server | 123-456-789 | ip_addr | 10.2.96.128 | abc123 |
After IHub ETL runs with my mappings, 3 CIs are created:
- Linux Server
- Network Adapter
- IP Address
I've configured the CI form for Linux Server to list all "Related Items" and can see that "My Server" has one Network Adapter and one IP Address. When I look in the "Network Adapters" tab at the bottom, I can see it listed. However, the "CI IPs" tab is empty.
Clicking on the IP Address listed in the "Related Items" section shows me the IP Address was not properly linked to a Network Adapter (i.e. the Nic field is blank). If I type in the IP Address into that field and select the Network Adapter that appears (which has the same name as the IP Address) then the relationship works and I can see the IP Address within the "CI IPs" tab.
I must be doing something wrong here. I've tried a number of different mappings to produce a valid relationship between Network Adapter and IP Address, but nothing so far has worked.
Does anyone know how to properly map these items via IntegrationHub?
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2023 12:32 PM - edited ‎11-06-2023 12:33 PM
@pratiksha5 @ivaroen It's been a long time since I solved this problem, and it turns out the solution I marked as accepted was actually not correct. Well, at the time it as. But I eventually discovered that my lookup logic was only working due to previously running my integration and forgetting to clear out the old sample data before re-running it.
If I remember correctly, the actual solution I implemented was by essentially fabricating network adapters. Recalling my data in the original post, I had separate lists of Network Adapters and IP Addresses that were unlinked. In order to get IPs showing up on the CI view, I essentially created "fake" Network Adapters (one per IP) and then associated the CIs with those NICs. This was the solution ServiceNow engineers had me implement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2023 01:12 AM
Thanks - from what I am doing now - and the way I understand it - it seems IP has a reference to a NIC (not a relation) and a relation to a e.g. Server. So ended up not creating the relationship between IP and Adapter, but a relationship between Server and IP.