import telnetlib
def telNetCall():
host = "10.200.1.23"
user = "me"
password = "matrix"
telnet = telnetlib.Telnet(host)
telnet.read_until('Username: ', 3)
telnet.write(user + '\r')
telnet.read_until('Password: ', 3)
telnet.write(password + '\r')
telnet.write("sh log"+ "\r\n")
telnet.write('exit' + '\r')
print telnet.read_all()
My problem is that when I try to grab "show log" from cisco router, it gives me just partial result, I thing it is because you need to hit space bar 5 times (depends how long is log history) to get full log-when I do it manualy, and I don't know how to tell python to list full log. Any suggestion?