11-11-2023 01:01 AM
Hi,
Is it possible to use DNAC (non SDA environment) to report on switches which have a particular config setting.
I'm looking to identify any switches in DNAC which have a legacy NTP server set. As DNAC holds all the current configs for my devices I'm hoping there a way to search and report on the existence of a particular IP Address in the running config arhives, without the need to select and search every switch?
11-11-2023 07:13 AM
You can use the Command Runner Tool to accomplish this task:
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
02-07-2025 12:15 PM - edited 02-07-2025 12:16 PM
This is helpful, but unfortunately DNAC/Catalyst Center only allows command runner for up to 20 devices at a time. It would be more useful to be able to download all running-config to several text files then grep against them for the config needed.
I've done this by painstakingly downloading each running config from the configuration viewer, then once all config files were in a single folder, I run this command from a terminal prompt within the folder path:
egrep "^interface Vlan" -A 4 *.txt | grep-v 'mac' | grep -v 'helper' > ./interfaceVLAN.txt
this grep command will look for any matches starting with "interface Vlan" then grab the next four lines of text (-A 4). from any .txt file (*.txt) within the folder. I then added a few more arguments to filter out stuff I don't care about (any lines containing 'mac' or 'helper'). Finally, it saves the output of the command into a file call interfaceVLAN.txt
Next I'll open that file and command+F to find whatever I'm looking for. This works for any config you want to compile.
There is probably a way to tap into the DNAC API to pull configs in a single batch, but I haven't figured out how to do that yet.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide