here is a sample of teh code I am using to test getting into the switch.
#!/usr/local/bin/perl -w use Net::Telnet::Cisco; use strict; my $debug = 1; my $IP_Addr = ""; my $switchPassword = ""; my $routerPassword = ""; my $routerEnPassword = ""; my $switchEnPassword = ""; ## Get the IP Address if ($IP_Addr eq "") { print "Enter the IP Address: "; chop($IP_Addr = <STDIN>); system("stty echo"); print "\n"; } ## Get the switchPassword (make it invisible when entering) if ($switchPassword eq "") { print "Enter the switch password: "; system("stty -echo"); chop($switchPassword = <STDIN>); system("stty echo"); print "\n"; } print "\tConnecting to $IP_Addr\n" if ($debug); my $cs = Net::Telnet::Cisco->new(Host => $IP_Addr); my $ok = $cs->login('login', $switchPassword) or die "Error lo +gging in: @{[ $cs->errmsg() ]}\n"; print "Logged into Switch\n" if ($debug); #Turn off paging my @cmd_output = $cs->cmd( 'terminal length 0' ); #Enter enable mode if ($switchEnPassword eq "") { print "Enter the enable password for the switch: "; system("stty -echo"); chop($switchEnPassword = <STDIN>); system("stty echo"); print "\n"; } $ok = $cs->cmd("enable\n$switchEnPassword"); print "entered enable mode\n"; #$i = 0; #$total = 0; my @portInfo = $cs->cmd("sho port status "); print "Here"; my $arrayElement; foreach $arrayElement (@portInfo) { print "$arrayElement\n"; } ## end foreach() $ok = $cs->disable; $ok = $cs->cmd("session 15\n$routerPassword"); $ok = $cs->cmd("enable\n$routerEnPassword"); my @intStuff = $cs->cmd("dir"); foreach $arrayElement (@portInfo) { print "$arrayElement\n"; } ## end foreach() exit;
The only difference I see between teh prompts of the router, and the prompts of the switch is that with the router prompts "Password:" and the switch prompts "Enter password:"

In reply to Re: Net::Telnet::Cisco with the 6000 chassis by ericj
in thread Net::Telnet::Cisco with the 6000 chassis by ericj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.