http://www.perlmonks.org?node_id=1049727


in reply to Cisco Telnet

Checkout whether Net::Telnet::Cisco has the possiblity to define a network timeout.

Update: A quick look at the manual pages let me find this:

$ok = $obj->login([Name => $username,] [Password => $password,] [Passcode => $passcode,] # for Secur-ID/XTACACS [Prompt => $match,] [Timeout => $secs,]);

I would try to find a feasible value for 'Timeout'.

McA

Replies are listed 'Best First'.
Re^2: Cisco Telnet
by mvip (Acolyte) on Aug 19, 2013 at 11:23 UTC

    Tnx for the reply ... McA i wast trying with that but not working ... i put 10 seconds for timeout but nothing the script just end stoped ....

      Hi,

      In Re: Cisco Telnet ~~David~~ is showing you how to wrap the call to login with an eval block to catch an exception. Then you are able to log that issue and proceed in your loop.

      Is that what you meant?

      McA

        well no, and i try that eval procedure and it just gave me the error massage that is saying the router is down and can't connect and the script end. I need something that will tel me that and continue. For example if i have 100 routers and the script start from 1 and as he going on 2,3,4,5 ... (lets say that router 10 is down ) when he comes to router 10 to say i can't connect to this router, and to moves on, and that is router 11, 12, 13 ... not to stop and end. For now iv try eval procedure and with sub routines and iv got nothing ... and i need this because i have to set the same config and settings on almost 300 routers and some of them are down some of them are not that ip end etc.