devilpanther
Programmer
I'm trying to use the Net::Telnet but I have a small problem.
I connect the server and send a command.
The server receives the command and sends me the output.
The thing is, because the output is not complete but has a: --MORE-- at the bottom is makes the
@lines = $telnet->cmd("show port physical 5/3"); to timeout...
(using a packet sniffer I can see that the server sends data back to the client)
How can I avoid this kind of problem?
Thank you.
I connect the server and send a command.
The server receives the command and sends me the output.
The thing is, because the output is not complete but has a: --MORE-- at the bottom is makes the
@lines = $telnet->cmd("show port physical 5/3"); to timeout...
(using a packet sniffer I can see that the server sends data back to the client)
How can I avoid this kind of problem?
Code:
#!/usr/bin/perl
use Net::Telnet;
$telnet = Net::Telnet->new(Prompt => '', Timeout => 10) or die "unable to init";
$telnet->open("192.169.1.1") or die "unable to connect server";
$telnet->login("username", "password") or die "unable to login";
[b][COLOR=red]@lines = $telnet->cmd("show port physical 5/3");[/color]
[COLOR=green]# this line never returns[/color][COLOR=green]a value but simply timeouts[/color][/b]
print @lines;
Thank you.