ssistance Needed for Discovery and Relationship Mapping of Rack CIs by pattern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 11:39 AM
We are encountering issues while configuring ServiceNow to autonomously discover and establish upstream and downstream relationships for non-IP-based rack Configuration Items (CIs) within our CMDB. The intended process does not seem to align with non-IP-based discovery procedures, resulting in unsuccessful attempts and error messages.
Actions Taken:
- Developed an active Discovery Pattern titled "RackContainby" in the Pattern Designer targeting the "Rack" CI type, aiming to recognize racks through attributes rather than IP addresses.
- Populated the Identification Section with specific criteria, such as the name (A-2-3, A-2-4, A-2-6) and asset tags of the racks.
- Encountered a "DNS lookup failed for host null" error during the debugging phase, suggesting issues with the pattern or Discovery setup.
- Confirmed that the rack configurations in the CMDB are devoid of IP addresses to match their non-IP-based nature, with attributes inclusive of name, asset tag, power consumption, and rack units details.
- Manually assessed suggested relationship types in the Relationship Editor for rack A-2-4, but found this approach to be inefficient for our needs.
Expected Result: The Discovery pattern should reliably discern the designated racks based on their pre-defined attributes and consequentially orchestrate the accurate upstream and downstream relationships in the CMDB.
Actual Result: A DNS lookup error impeded the pattern debug process. The Discovery pattern failed to recognize and associate the racks as required, indicating a shortfall in managing non-IP-based CI relationships through the current Discovery process.
We see your help in :-
- Resolving the "DNS lookup failed for host null" error that emerged during pattern debugging.
- Refining the Discovery pattern to accurately discover and associate non-IP-based rack CIs.
- Validating the comprehensive mapping of the upstream and downstream relationships for rack CIs.
Alternate is automation. We went over the GitHub and fine-tuned what our Python script should look like. We could not find a similar prewritten scripts in our setup, that we could reuse for our discovery, and your guidance will help us save time.
Script Development Process:
The script is developed in Python, utilizing the requests library for API interactions. It is constructed to:
- Securely authenticate with the ServiceNow API.
- Perform robust error handling and logging to aid in troubleshooting and to ensure the accuracy of CMDB updates.
- Utilize parameterization for scalability and flexibility, allowing it to handle various CI classes and relationship types.
Given the encountered DNS issue, which seems to be a network or ServiceNow instance configuration problem, the script remains untested. Therefore, part of the support request includes assistance in resolving the connectivity issue to proceed with the testing and eventual deployment of the script.
Script Execution and Expected Outcomes:
Upon successful execution, the script is expected to:
- Identify rack CIs in the CMDB that lack IP addresses.
- Create relationships based on predefined logic that mirrors our data center setups.
- Update the CMDB without manual intervention, ensuring that it remains a reliable source of truth for our IT infrastructure.
The script would run on a schedule or be triggered by specific events (e.g., addition of new rack CIs), thus keeping the CMDB up to date with minimal manual oversight.
Script Overview: The script performs the following functions:[Attached]
- Retrieves the sys_id for given rack names.
- Creates relationships between specified CIs using the relationship type name provided.
- Provides verbose error messages for troubleshooting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 06:37 AM
Hi @VarDug ,
You need to create the custom pattern and use the OOB relationship available with CI to Rack, as OOB rack having power by relationship with Computer and you can utilize the same
Rack having below relationship like
Contained By (Contains::Containbed By) - Datacenter Zone
Powered By (Powers ::Powered By) - Circuit
Zone contains (Located in zone::Zone Contains) -Datacenter Zone
Power (Powers::PoweredBy) - Computer
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thanks
AJ
Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/
ServiceNow Community Rising Star 2024