10-24-2019 10:53 AM
I have a modern network with DNAC and Cat 9k switches. Given a static list of IPs , I'm trying to find a programmatic way of bouncing the interfaces those devices are connected to.
I know how to query DNAC with a Client's IP and have it return the Switch & Switchport the Client is connected to, but I can't work out how, either via DNAC or via Netconf to the Switch, to bounce the interface (ie, "Shutdown" followed shortly by "No Shutdown" in CLI terms).
Are there any examples of how to achieve this? Or suggestions of the best approach? It seems quite basic and I'm surprised I can't find any examples of how to bounce a port.
Thanks!
10-24-2019 11:21 AM
Not sure what is the end goal you looking to achieve. But here is simple Linux script with expect command :
here is example script : (you can do many things :)
10-24-2019 09:52 PM
10-25-2019 12:43 AM
If you looking to Build one, you need to list what you like to achieve, based on the post you looking for bounce the ports, so i have suggested the method to do the same.
if you looking if the ports gone disabled - this bit tricky, not that its not possible, - some time you need to investigate whu this ports gone error disabled ?
on programming point of view. send all the logs to syslog server - capture the logs, trigger the script.
you can send me personal message if you like more to do frame work we can discuss. (this is my favourite topic) self healing with out engineer intervention.
11-08-2019 07:00 AM
How are you getting the data from DNAC? Is it something you can work with easily (JSON, XML, etc)? Does it include the IP of the switch the hosts are on?
You could write something in python to take that and restconf the ports up/down
03-27-2021 12:32 PM
can be solved with bash and ansible
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