Part of the deploy section for automation need some help.. If I wanted to create a script with the below show commands and save to to bootflash, what do you guys think would be the best way to do that?
show ip interface brief
show ip ospf neighbor
show ip route
show interface [interface name]
I'm thinking the below is a start but having trouble with the variable for the last show command
from cli import *
output = ["show ip int br",
"show ip ospf neighbor",
"show ip route",
"show interface
]
with open("/bootflash/guest-share/PYTHON-TST.txt","w") as TST:
for cmds in output:
output = cli(cmds)
TST.write(cmds)
TST.write("\n\n")
TST.write(output)
TST.write("\n\n")
print("#"*100)
print("Saving show commands to file in bootflash")
print("#"*100)