llod45 has asked for the wisdom of the Perl Monks concerning the following question:
####END CODE#!/usr/bin/perl no strict; #### Define Library Locations ### #use lib '/root/Net-Telnet-3.03/blib/lib/Net/';use lib '/root/Net-Teln +et-Cisco-1.10/blib/lib/'; #### Define Modules to use #### use Net::Telnet::Cisco; #### Create Telnet Connection to Device#### my $telnet = Net::Telnet::Cisco->new(Host=>'1.2.3.4 2005', Timeout=>2, Errmode=>'die'); $telnet->waitfor('/Username:/') or die('FAILED'); $telnet->print('xxxx'); $telnet->waitfor('/Password:/') or die('FAILED'); $telnet->print('xxxx'); #$telnet->send_wakeup('connect'); $telnet->waitfor('/PROMPT>/'); @output = $telnet->cmd('show ver'); print @output;
Edit by tye: Add CODE tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telneting to a 2511 Access Server Device on line 2005
by jasonk (Parson) on Mar 29, 2005 at 20:50 UTC | |
| |
|
Re: Telneting to a 2511 Access Server Device on line 2005
by Fletch (Bishop) on Mar 29, 2005 at 20:49 UTC | |
by llod45 (Initiate) on Mar 30, 2005 at 19:11 UTC |