Hello Guys,
I created script which executes few outputs on Cisco Routers.
Script is working fine , it logs to device and executes commands.
But I don't know how force Python to save those outputs to Text Document.
Please help.
import getpass
import sys
import telnetlib
print ("Script starts")
HOST = "71.61.14.36"
tn = telnetlib.Telnet(HOST, "33153",)
print ("Telnetting to device")
tn2 = telnetlib.Telnet(HOST, "33154",)
print ("Telnetting to device")
print ("Executing commands")
tn.write("\n\n\n\n")
tn.write("\n\n\n\n")
tn.write("enable\n")
tn.write("show ip interface brief\n")
tn.write("show interfaces description\n")
print ("Executing commands")
tn2.write("\n\n\n\n")
tn2.write("\n\n\n\n")
tn2.write("enable\n")
tn2.write("show ip interface brief\n")
tn2.write("show interfaces description\n")
tn2.close()