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

Re: Unable to get Net::Telnet::Cisco to connect to router

by shockme (Chaplain)
on Nov 13, 2003 at 22:58 UTC ( #306961=note: print w/replies, xml ) Need Help??


in reply to Unable to get Net::Telnet::Cisco to connect to router

I'm not sure why that's not working. Here's a sample from a script which does work:
my $SwitchIP = '192.168.0.1'; my $password = 'seekrit'; my $t = new Net::Telnet::Cisco (Timeout => 10, Dump_log => 'dump.log', Input_log => 'input.log', Port => 2011, ); $t->open("$SwitchIP"); $t->login(Password => $password);
Hope that helps.

Update: I think see why your script isn't working. According to the Net::Telnet::Cisco docs, you need to issue a login command:

my $session = Net::Telnet::Cisco->new(Host => '123.1.1.1'); $session->login('login', 'password');
Your script seems to be correctly setting up the session, but you're issuing commands before you've logged into the router.

If things get any worse, I'll have to ask you to stop helping me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://306961]
help
Chatterbox?
[Tanktalus]: SwaJime: wouldn't status & status < 13 be true if status was 0?
[SwaJime]: I thought 0 was false, and false AND anything would be false ...
[SwaJime]: unless & is higher precedence than <
[SwaJime]: couldn't find bitwise in precedence list for sybase
[SwaJime]: I bet that is why ... and that makes it to be I think terribly written code :-|

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-08-22 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (338 votes). Check out past polls.

    Notices?