Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Where is my Net::Telnet output

by jettero (Monsignor)
on Jul 05, 2011 at 11:59 UTC ( #912810=note: print w/replies, xml ) Need Help??

in reply to Where is my Net::Telnet output

IOS is annoying to interact with via scripts. Have fun. I highly recommend Net::Telnet::Cisco. It helps quite a lot with some of the more annoying things.

Replies are listed 'Best First'.
Re^2: Where is my Net::Telnet output
by Anonymous Monk on Jul 05, 2011 at 13:06 UTC
    thanks for the reply. I just tried with Net::Telnet::Cisco and it works. However there 9k boxes that we have have a prompt of "RP/0/RSP0/CPU0:9K-PO1". For such a prompt my connection is not working. Do you know if there is a fix that I can use for this to work. TIA
      Hi, The regexp that is evaluating the prompt doesn't include the characters ":" and "/" that are present in your router names. So you have to alter the regexp used for the prompt. If you create the Net::Telnet::Cisco object "$obj" you can see what regexp is used with   print $obj->prompt, "\n"; And alter it with   $obj->prompt('/(?m:^[\w.:\/-]+\s?(?:\(config[^\)]*\))?\s?[\$#>]\s?(?:\(enable\))?\s*$)/'); The regexp I used above includes your special characters. So that should work.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://912810]
[Corion]: Meh. My lack of embedded Pg is showing. I can get the data for an image gallery with one SQL statement, but not with SQLite as it doesn't do window functions :-(
[Corion]: Hmmm. Maybe I can still fake the one spot where I want/need a window function in SQLite... I think I'm never really interested in the real "next" image (not hidden/deleted)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2018-03-23 17:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (295 votes). Check out past polls.