|
|||
|
JEHERUL wrote:
> Dear All > > I am trying to telnet to a Cisco router . Following is my code . > > #code router.py > > import getpass > import sys > import telnetlib > > HOST = "router address" # router address is ommitted for > security reason > user = raw_input("Username : ") > password = getpass.getpass() > > tn = telnetlib.Telnet(HOST) > > tn.read_until("Username: ") > tn.write(user + "\n") > tn.read_until("Password: ") > tn.write(password + "\n") > > > tn.read_until("I>") > tn.write("sh int f0/0") > > print "Just to check" > > > print tn.read_all() > > print "after read" > tn.write("exit\n") > > > > But when I execute the program I got the following error . > > > Traceback (most recent call last): > File "router.py", line 23, in ? > print tn.read_all() > File "/usr/lib/python2.4/telnetlib.py", line 330, in read_all > self.fill_rawq() > File "/usr/lib/python2.4/telnetlib.py", line 521, in fill_rawq > buf = self.sock.recv(50) > > Please help me . > > Regards > -- > Jeherul Islam > Indian Institute of Information Technology and Management . > Gwalior (MP) > > Hi, Your error trace is incomplete it's missing the exception. It would be better if you provide it. JM |
|
|
||||
|
||||
|
|
![]() |
| Popular Tags in the Forum |
| problem, telnetlib |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JSLint Reports on last 2 Production Versions of jQuery | lorlarz | Newsgroup comp.lang.javascript | 107 | 03-09-2010 08:51 AM |
| Is there any more benifits by virtual inheritance than resolving the"diamond problem" ? | thomas | Newsgroup comp.language.c++ | 9 | 11-27-2009 12:08 PM |
| Re: can anybody help this problem | Lewis Jordan | Newsgroup comp.soft-sys.sas | 0 | 02-18-2009 03:12 PM |
| Re: Update: SAS/InrNet Application Dispatcher Problem | Alan Churchill | Newsgroup comp.soft-sys.sas | 1 | 12-09-2007 03:59 AM |
| Re: SAS Problem | nospam@HOWLES.COM (Howard Schreier | Newsgroup comp.soft-sys.sas | 0 | 05-03-2006 03:23 AM |