ServiceNow’s Configuration Management Database (CMDB) plays a critical role in ensuring that IT infrastructure components are properly tracked, managed, and maintained. One key feature that enhances the functionality of the CMDB is CMDB Health—which includes data accuracy, completeness, and compliance indicators. To ensure optimal health of your CMDB, Inclusion Rules are used to define which configuration items (CIs) are considered in the health assessment.
However, manually configuring Inclusion Rules for specific CI classes can be a tedious and static process. To overcome this limitation, you can make your CMDB Health Inclusion Rules dynamic by leveraging Inclusion Rules based on Principal Classes. This method ensures the rules adapt automatically to changes in the environment or CI structure.
Inclusion Rules are used to define the scope of configuration items that should be considered in CMDB Health checks. By default, the scope of Inclusion Rules is static, meaning they are hardcoded for specific CI classes. If you add new CIs or create custom classes, the static rule needs to be manually updated.
Here’s a step-by-step guide to make Inclusion Rules dynamic using an Advanced Reference Qualifier based on Principal Classes.
1. Identify Principal Classes
Principal classes in ServiceNow are typically high-level classes like cmdb_ci_computer, cmdb_ci_appl, cmdb_ci_database, and so on. These are often parent classes, and their child classes inherit properties and attributes from them. We want to leverage this hierarchy to dynamically include all children of a principal class.
2. Create a Dynamic Inclusion Rule
To apply a Dynamic Inclusion Rule, you will need to create a script that populates the condition field..
Here’s a sample script for an Dynamic Inclusion Rule Qualifier:
The script dynamically creates or updates a CMDB Health metric rule in ServiceNow, targeting CIs based on the principal class and applying additional filters. It ensures the rule is applied to the specified CI table and uses the provided metric to configure the rule’s condition.
3. Apply the CMDB Qualifier
To apply this script:
Leveraging ServiceNow to create Dynamic Inclusion Rules for CMDB Health is a powerful way to manage a complex and evolving IT environment. By automating the inclusion of classes based on principal class hierarchies, you enhance the accuracy, efficiency, and scalability of your CMDB Health process, ensuring your IT assets are always aligned with the organization’s needs.
Interested to learn more? Reach out to chat@rapdev.io
We go further and faster when we collaborate. Geek out with our team of engineers on our learnings, insights, and best practices to unlock maximum value and begin your business transformation today.
Transforming IT with automation, insight, and scale with ServiceOps
Explore how RapDev's Arlo agents leverage ServiceNow’s AI framework to automate tasks, improve accuracy, and streamline platform operations
RapDev’s AI Agent Starter Pack helps you identify, design, and deploy 5 powerful agents that plug directly into your ServiceNow environment.