I am using Net::Telnet::Cisco. My program appears to wait for the prompt
except when issuing the "wr" command or copy running-config command.

Please see the dump.log output below.

The router: IOS (tm) 2500 Software (C2500-J-L), Version 11.2(14)

The cisco module methods seem to work well for login, enable, and cmd('show
version'). I run into a problem when I issue cmd('wr'). The router returns
the following text:

Building configuration...
[OK]

According to the dump.log as soon as the 'wr' command is sent the program
continues to the end. My timeout for the commands is set to 40 seconds. The
'wr' command is executed, then the TFTP command is executed, then the
response from the 'wr' is echoed.

< 0x00000: 5e 5a 0d 0a  63 31 39 34  6e 23 0d 0a  63 31 39 34
^Z..c194n#..c194
< 0x00010: 6e 23                                               n#

> 0x00000: 77 72 0d 0a                                         wr..

> 0x00000: 63 6f 70 79  20 72 75 6e  6e 69 6e 67  2d 63 6f 6e  copy
running-con
> 0x00010: 66 69 67 20  74 66 74 70  0d 0a 31 36  33 2e 32 34  fig
tftp..163.24
> 0x00020: 31 2e 31 35  34 2e 31 38  36 0d 0a 63  31 39 34 6e
1.154.186..c194n
> 0x00030: 2d 63 6f 6e  66 67 0d 0a  0d 0a 0d 0a               -confg......

< 0x00000: 77 72 0d 0a  42 75 69 6c  64 69 6e 67  20 63 6f 6e  wr..Building
con
< 0x00010: 66 69 67 75  72 61 74 69  6f 6e 2e 2e  2e 0d 0a 5b
figuration.....[
< 0x00020: 4f 4b 5d 0d  0a 63 31 39  34 6e 23 63  6f 70 79 20
OK]..c194n#copy 
< 0x00030: 72 75 6e 6e  69 6e 67                               running

I even scrapped the cmd method and implemented:

$session->print('wr');
$session->waitfor('/\[OK\]/');

This also does not seem to way. Adding "sleep 40;" after the 'wr' command
and another "sleep 40;" after the TFTP command got the program to work. This
however is not solution. Any assistance or insight would be greatly
appreciated.

Howard A. Bullock
Global IT Infrastructure
717-810-3584

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to