Posted on 2009-02-18 02:02:12-08 by woodsbc
Timeout during command execution

Oliver,

I am issuing some commands like 'copy running-config tftp' and issuing the required carriage returns for it to start executing the command. However, in the middle of the transfer, the script disconnects from the host with the error of 'pattern match timed-out'. The routers that this occurs on have configurations that are much larger than the ones that successfully execute. These are SSH connections. Where do I increase the timeout value for this?

Thanks.

Brian

Direct Responses: 9995 | Write a response
Posted on 2009-02-18 06:38:21-08 by oliver in response to 9993
Re: Timeout during command execution
Hi Brian,

There are two ways to set a longer timeout, as mentioned in the manual.

The first is on a per-command basis, you issue something like:

$s->cmd(String => 'copy running-config tftp', Timeout => 60);

Or you can set it globally (i.e. will be used for all subsequent commands), and this is done via the Net::Telnet method:

$s->timeout(60);

I hope this helps,

regards,
oliver.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.