I am trying to the Net::Telnet::Cisco module to connect to my router. However, I am unable to get it to work. Typically
I connect to my router with the following command.
telnet foo 2011
The console port of the router is connected to a term server. foo is the hostname for the term server and 2011 is the port that is connected to.
Here is some simple code that I can't get to work. What am I doing wrong??
use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host => 'foo',
Port => 2011);
# This is just a simple cmd to see if it ever works
my @output = $session->cmd('sh clock');
print @output;
$session->close;
I can't believe I am having this much difficultly for something so simple.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|