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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Guys, I am facing same issue, I can get into Terminal Server but from there, I couldn't enter in line. "Clear line x" is not working for me. Command timing out on that spot. On line 3 I have linux box I want to access, maually it works please let me know if I need any correction in my script.
#!/usr/bin/perl use Net::Telnet::Cisco; my $session = Net::Telnet::Cisco->new(Host => '172.18.56.3'); $session->login('', 'aryaka'); # Execute a command my @output = $session->cmd('show line '); print @output; # Enable mode if ($session->enable("aryaka") ) { my @output1 = $session->cmd('show ver '); print @output1; my @command = $session->cmd('clear line 3 '); $session->prompt("/[Confirm]/"); $session->print("\n"); my @command = $session->cmd('device3'); #$session->always_waitfor_prompt; $session->print("\n"); $session->print("\n"); my @output3 = 'ifconfig' ; print "ifconfig: @output3\n"; } else { warn "Can't enable: " . $session->errmsg; } $session->close;
Output:
C:\Users\rpatel\Desktop\Perl>perl Login.pl "my" variable @command masks earlier declaration in same scope at Logi +n.pl line 24. Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overru +ns Int 0 CTY - - - - - 0 0 0/0 + - 1 TTY 115200/115200- - - - - 17 34 461/1 +381 - 2 TTY 115200/115200- - - - - 8 57 402/1 +198 - 3 TTY 115200/115200- - - - - 25 31 141/4 +12 - 4 TTY 115200/115200- - - - - 14 14 17/5 +1 - 5 TTY 115200/115200- - - - - 7 0 0/0 + - * 6 TTY 115200/115200- - - - - 2 0 0/0 + - 7 TTY 115200/115200- - - - - 6 8 529/1 +613 - 8 TTY 9600/9600 - - - - - 5 1196 2744/1 +2 - 9 TTY 115200/115200- - - - - 9 14 24/6 +8 - 10 TTY 115200/115200- - - - - 5 5 592/1 +768 - 11 TTY 115200/115200- - - - - 5 0 0/0 + - 12 TTY 115200/115200- - - - - 0 2 8/2 +3 - * 13 TTY 9600/9600 - - - - - 4 33 8352/2 +5150 - 14 TTY 115200/115200- - - - - 5 1 44/1 +33 - 15 TTY 115200/115200- - - - - 2 0 0/0 + - 16 TTY 19200/19200 F - - - - 2 0 0/0 + - 17 AUX 9600/9600 - - - - - 0 0 0/0 + - * 18 VTY - - - - - 17 0 0/0 + - * 19 VTY - - - - - 132 0 0/0 + - * 20 VTY - - - - - 56 0 0/0 + - 21 VTY - - - - - 19 0 0/0 + - Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overru +ns Int 22 VTY - - - - - 17 0 0/0 + - Cisco Internetwork Operating System Software IOS (tm) 2500 Software (C2500-I-L), Version 12.0(5)T, RELEASE SOFTWAR +E (fc1) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Fri 23-Jul-99 03:14 by kpma Image text-base: 0x03039754, data-base: 0x00001000 ROM: System Bootstrap, Version 11.0(10c)XB1, PLATFORM SPECIFIC RELEASE + SOFTWARE (fc1) BOOTFLASH: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c)XB1, + PLATFORM SPECIFIC RELEASE SOFTWARE (fc1) ANAP-stack-Term-Server uptime is 3 weeks, 2 days, 20 hours, 34 minutes System returned to ROM by power-on System image file is "flash:c2500-i-l.120-5.T" cisco AS2511-RJ (68030) processor (revision K) with 2048K/2048K bytes +of memory Processor board ID 21339790, with hardware revision 00000000 Bridging software. X.25 software, Version 3.0.0. 1 Ethernet/IEEE 802.3 interface(s) 1 Serial network interface(s) 16 terminal line(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash (Read ONLY) Configuration register is 0x2102 command timed-out at Login.pl line 20

In reply to Re^4: Net::Telnet::Cisco and Terminal Server by Anonymous Monk
in thread Net::Telnet::Cisco and Terminal Server by perldragon80

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others surveying the Monastery: (4)
    As of 2024-09-11 14:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (13 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.