perldragon80 has asked for the wisdom of the Perl Monks concerning the following question:
I want to write a script that allows me to login to a terminal server, that is connected to a cisco router serial port:
But I am having a problem with the Net::Telnet::Cisco portion timing out. I assume this has to do with the console server interraction. Here are the exact steps I want to happen:
1)Telnet <IP> <Port number> of console server
2)Issue a couple carriage returns to bring up password prompt
3)Issue login password and then enable password
4)Once logged in, issue some commands
5)Logout
Any help is greatly appreciated! (Code Snippet Below)
But I am having a problem with the Net::Telnet::Cisco portion timing out. I assume this has to do with the console server interraction. Here are the exact steps I want to happen:
1)Telnet <IP> <Port number> of console server
2)Issue a couple carriage returns to bring up password prompt
3)Issue login password and then enable password
4)Once logged in, issue some commands
5)Logout
Any help is greatly appreciated! (Code Snippet Below)
my $session = Net::Telnet::Cisco->new(Host => '192.168.200.20', port = +> '2036' ); # The following is not necessary because only a password # prompt is shown... $session->login('password','password'); my @output = $session->cmd("show version"); print @output; # Enable mode if ($session->enable("enable_password") ) { @output = $session->cmd('show interfaces eth summary'); print "My privileges: @output\n"; } else { warn "Can't enable: " . $session->errmsg; } $session->close;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::Telnet::Cisco and Terminal Server
by zer (Deacon) on Mar 17, 2006 at 05:53 UTC | |
by skum (Initiate) on Mar 25, 2009 at 21:36 UTC | |
by skum (Initiate) on Mar 25, 2009 at 21:46 UTC | |
by Anonymous Monk on Mar 22, 2013 at 19:19 UTC | |
by Anonymous Monk on Jul 15, 2014 at 14:48 UTC | |
Re: Net::Telnet::Cisco and Terminal Server
by zer (Deacon) on Mar 16, 2006 at 23:47 UTC | |
by perldragon80 (Sexton) on Mar 16, 2006 at 23:57 UTC | |
Re: Net::Telnet::Cisco and Terminal Server
by zer (Deacon) on Mar 17, 2006 at 00:13 UTC | |
by perldragon80 (Sexton) on Mar 17, 2006 at 00:19 UTC | |
Re: Net::Telnet::Cisco and Terminal Server
by leighsharpe (Monk) on Mar 17, 2006 at 03:09 UTC |
Back to
Seekers of Perl Wisdom