Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Cisco Telnet

by McA (Priest)
on Aug 16, 2013 at 11:37 UTC ( #1049727=note: print w/replies, xml ) Need Help??

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'.


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 ....


      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?


        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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049727]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-06-19 17:18 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.