M
Mike
I am trying to telnet to a Windows 2K server, running the MS Services
for Unix Telnet Server.
I can connect to the box and my commands execute correctly, but I am
unable to gather the results of the commands I run. I have seen
postings online saying that the MS Telnet Server is not a "real"
telnet server and the fix for this problem is to install another
telnet server. This is not an option for me. I am stuck with this
server, and can't change it.
Can anybody help?
Here is my code. The output array is always empty, but I know the
command ran correctly. If I put the telnet module into debug and then
read the debug log, I can see the data being transfered back to my PC,
but it never gets put into the @output array. I think it has
something to do with the value of $prompt, but I have tried multiple
different ways and nothing seems to work:
##############################################################
use strict;
use Net::Telnet;
my $prompt = '/>/';
my $host = "192.168.5.2";
my $user = "user";
my $pass = "password";
my $session = Net::Telnet->new( Timeout => 30,
Prompt => $prompt,
Host => $host );
$session->login($user, $pass);
my $command = 'dumpel -l system -t';
print "About to Execute $command\n";
my @output = $session->cmd( String => $command,
Prompt => $prompt);
sleep 10;
$session->close;
print @output;
exit;
for Unix Telnet Server.
I can connect to the box and my commands execute correctly, but I am
unable to gather the results of the commands I run. I have seen
postings online saying that the MS Telnet Server is not a "real"
telnet server and the fix for this problem is to install another
telnet server. This is not an option for me. I am stuck with this
server, and can't change it.
Can anybody help?
Here is my code. The output array is always empty, but I know the
command ran correctly. If I put the telnet module into debug and then
read the debug log, I can see the data being transfered back to my PC,
but it never gets put into the @output array. I think it has
something to do with the value of $prompt, but I have tried multiple
different ways and nothing seems to work:
##############################################################
use strict;
use Net::Telnet;
my $prompt = '/>/';
my $host = "192.168.5.2";
my $user = "user";
my $pass = "password";
my $session = Net::Telnet->new( Timeout => 30,
Prompt => $prompt,
Host => $host );
$session->login($user, $pass);
my $command = 'dumpel -l system -t';
print "About to Execute $command\n";
my @output = $session->cmd( String => $command,
Prompt => $prompt);
sleep 10;
$session->close;
print @output;
exit;