Configure CMDB with CI classes, relationships, and discovery
✓Works with OpenClaudeYou are a ServiceNow CMDB administrator. The user wants to configure the Configuration Management Database (CMDB) by setting up CI (Configuration Item) classes, defining relationships between them, and enabling discovery processes.
What to check first
- Verify you have the
CMDBandDiscovery and Service Mappingplugins enabled in your ServiceNow instance via Plugins module - Check your user role includes
cmdb_adminoradminto access CMDB configuration tables - Review existing CI classes in CMDB > Administration > CI Classes to understand current schema
Steps
- Navigate to CMDB > Administration > CI Classes and click New to create a custom CI class that extends from a base class like
cmdb_ci_serverorcmdb_ci_app_server - Define the class properties: set Name, Label, Parent Class, and Table name (should follow naming convention like
cmdb_ci_custom_app) - Add custom attributes to your CI class by going to the Attributes tab and inserting new fields with appropriate field types (text, reference, choice, etc.)
- Create relationships between CI classes via CMDB > Administration > Relationships by defining From Class, To Class, Relationship Type (e.g., "depends on", "runs on"), and cardinality
- Configure Discovery patterns in Discovery and Service Mapping > Discovery > Patterns to auto-populate CIs—select probe type (SNMP, SSH, WMI), set credentials, and define CI matching rules
- Enable Reconciliation rules in CMDB > Administration > Reconciliation Rules to merge duplicate CI records based on matching attributes
- Test CI creation by manually adding a record to your custom CI class table, then verify relationships appear in CMDB > Assets > [Your CI Class]
- Schedule discovery jobs in Discovery and Service Mapping > Discovery > Discovery Schedule and set triggers (on-demand or recurring)
Code
// Script to programmatically create a CI class, add attributes, and establish relationships
(function() {
// Step 1: Create a new CI class
var ciClass = new GlideRecord('cmdb_ci_class');
ciClass.setValue('name', 'cmdb_ci_custom_database');
ciClass.setValue('label', 'Custom Database');
ciClass.setValue('parent', 'cmdb_ci_database'); // Extend from base database class
ciClass.setValue('table_name', 'cmdb_ci_custom_database');
ciClass.setValue('description', 'Custom CMDB CI class for enterprise databases');
var classId = ciClass.insert();
gs.info('Created CI class: ' + classId);
// Step 2: Add custom attributes to the CI class
var attribute1 = new GlideRecord('cmdb_ci_class_attribute');
attribute1.setValue('class_id', classId);
attribute1
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related ServiceNow Skills
Other Claude Code skills in the same category — free to download.
ServiceNow Scripted REST
Build Scripted REST APIs with request/response handling
ServiceNow Business Rule
Create business rules with before/after/async triggers and conditions
ServiceNow Flow Designer
Build automated workflows with Flow Designer actions and subflows
ServiceNow Client Script
Write client scripts for form manipulation (onChange, onLoad, onSubmit)
ServiceNow Catalog Item
Build service catalog items with variables, workflows, and fulfillment
ServiceNow Integration Hub
Connect ServiceNow with external systems using IntegrationHub spokes
ServiceNow ATF Testing
Write automated tests with Automated Test Framework
ServiceNow UI Builder
Build custom portal pages with UI Builder and components
Want a ServiceNow skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.