From: David Li <w.d...@gm...> - 2011-04-08 20:10:17
|
Hi Matt, Thanks the the link. I only want some basic stuff - sending CLI cmds and reading returns. I tried the simple example like this but the cmd execution hung with error messeages. No idea why. ---- script ------- use Net::Telnet::Cisco; my $router_addr = '172.27.122.88'; my $router_port = '2008'; my $session = Net::Telnet::Cisco->new(Host => $router_addr, Port => $router_port ); # $session->login('login', 'password'); # Execute a command my @output = $session->cmd('show version'); print @output; ------ execution ----- sjc-lds-545:perl$ ./cisco.pl Use of /g modifier is meaningless in split at /usr/cisco/packages/perl/perl-5.8.6/lib/site_perl/5.8.6/Net/Telnet/Cisco.pm line 756. Regards, David On Fri, Apr 8, 2011 at 11:22 AM, Matt Zagrabelny <mzagrabe@d.umn.edu> wrote: > You could use: > > http://search.cpan.org/~joshua/Net-Telnet-Cisco-1.10/Cisco.pm > > For some basic functionality. > > I've used Expect just fine with Cisco products, but there were issues > with threading. I've tried both Net::Telnet and Expect, but there were > still a couple issues. Now I just use Net::Telnet. > > -matt > > On Fri, Apr 8, 2011 at 12:19 PM, David Li <w.d...@gm...> wrote: > > Hi, Experts, > > I am new to Expect. Is there an example that > > uses both Net::Telnet and Expect to interact with Cisco routers? > > Regards, > > David > > > > > ------------------------------------------------------------------------------ > > Xperia(TM) PLAY > > It's a major breakthrough. An authentic gaming > > smartphone on the nation's most reliable network. > > And it wants your games. > > http://p.sf.net/sfu/verizon-sfdev > > _______________________________________________ > > Expectperl-discuss mailing list > > Exp...@li... > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > |