06-30-2021 10:06 AM
Hello,
Is it possible to run the script with the command?
show int g0/0.(variable from VLAN list)
I need to take details of more than 4000 sub interfaces
?
Thanks
06-30-2021 10:30 AM - edited 06-30-2021 10:31 AM
Not much detail to go on ie. what are you using to connect to the device etc.
I use Python and Netmiko so if I was doing it I would probably just do a "sh run" on the device and then parse the output grabbing the information I needed from each interface but like I say you don't really give much detail.
Jon
06-30-2021 11:07 AM
06-30-2021 12:06 PM
@sas2k3001 : Check this out
targets = [] for m1 in re.finditer("(GigabitEthernet\d.\d.\d+).*?buffers swapped out", cli_input, re.DOTALL): m2 = re.search("(?P<interface>GigabitEthernet\d.\d.\d+).*Last input never", m1.group(0), re.DOTALL) if m2: targets.append(m2.group("interface")) print(targets)
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