Add servicenow-cmdb-export CLI#15
Draft
adamswbrown wants to merge 1 commit into
Draft
Conversation
Pulls CMDB server and client CIs from ServiceNow and writes a denormalized device-to-business-app-and-environment mapping to Excel. Joins via cmdb_rel_ci with an assigned-user ownership fallback for clients that have no direct app relationship.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
servicenow-cmdb-exportPython CLI underservicenow-cmdb-export/. Connects to a ServiceNow instance over the Table API and writes a denormalized device-to-business-app-and-environment mapping to.xlsx.cmdb_ci_server) and client devices (cmdb_ci_pc_hardware), joining each to business apps viacmdb_rel_ci(relationship types: Runs on::Runs, Depends on::Used by, Hosted on::Hosts).cmdb_ci_environmentCIs (per the design call to model environment as a separate CI rather than theused_forfield).business_owner/managed_by/owned_by, capped by--max-apps-per-user(default 10).Output schema (
device_app_mapsheet)device_type | name | fqdn | environment | assigned_user | assigned_user_email | business_app | app_owner | criticality | support_group--rawadds extra sheets dumping the underlyingcmdb_ci_server,cmdb_ci_pc_hardware,cmdb_ci_business_app, andcmdb_ci_environmentrecords for auditing.Configuration
Env vars:
SNOW_INSTANCE,SNOW_USER,SNOW_PASSWORD(HTTP basic). See.env.example.Test plan
pip install -e servicenow-cmdb-exportsucceedssnow-cmdb-export --helpandsnow-cmdb-export server-app-map --helprendersnow-cmdb-export server-app-map --out cmdb.xlsx --device-type allenvironmentpopulates from a knowncmdb_ci_environmentCI--rawand confirm raw sheets present--querywith asysparm_queryfilter (e.g.operational_status=1) and confirm filtered resultshttps://claude.ai/code/session_01JgkCjwqTFGQBra1unq3d8v
Generated by Claude Code