Assess Cisco Catalyst Center with cnspec
Query and assess Cisco Catalyst Center (formerly DNA Center) with cnspec
Rely on cnspec to discover and assess network devices managed by Cisco Catalyst Center (formerly known as Cisco DNA Center).
Prerequisites
To connect to Cisco Catalyst Center with cnspec, you must have:
- cnspec installed on your workstation
- Network access to the Catalyst Center management interface
- Valid credentials (username and password) for API authentication
- A user account with appropriate permissions to access the Catalyst Center APIs
Give cnspec access to your Catalyst Center
To scan a Catalyst Center instance, cnspec connects through the Catalyst Center REST API. Ensure that your user account has API access.
Test your connection
Before running a full scan, verify that cnspec can connect by opening a cnspec shell:
cnspec shell ciscocatalyst catalyst.example.com --user admin --ask-passIf cnspec connects successfully and shows a prompt, you're ready to scan.
Connection options
| Option | Description |
|---|---|
--user | Username for API authentication |
--password, -p | Password for API authentication |
--ask-pass | Prompt for the password |
Scan Cisco Catalyst Center
To scan a Catalyst Center instance, use the cnspec scan command:
cnspec scan ciscocatalyst catalyst.example.com --user admin --ask-passProvide the password when prompted.
You can also create your own policies to meet your specific requirements.
Example queries
You can interactively explore and test checks using the cnspec shell. To open a shell connected to your Catalyst Center:
cnspec shell ciscocatalyst catalyst.example.com --user admin --ask-passList managed network devices
cnspec> ciscocatalyst.devices
ciscocatalyst.devices: [
0: ciscocatalyst.device hostname="switch1.example.com"
1: ciscocatalyst.device hostname="router1.example.com"
...
]Retrieve device details
cnspec> ciscocatalyst.devices { hostname managementIpAddress platformId softwareVersion }
ciscocatalyst.devices: [
0: {
hostname: "switch1.example.com"
managementIpAddress: "192.168.1.10"
platformId: "C9300-48P"
softwareVersion: "17.3.4"
}
...
]Learn more
-
To learn more about how the MQL query language works, read Write Effective MQL.
-
For more information about Cisco Catalyst Center, see the Cisco Catalyst Center documentation.