C
chandrasekhar.karanam
Hi,
I wrote a perl file to telnet to Windows host using Net::Telnet.
Once I telnet to remote host I execute a perl script.
I am facing the problem with timeout, If I give default time out the
script fails to execute within the time, if I give more time out then
perl script executes but still it will not close the telnet session
until the time out reaches.
Below is the script
my $tel_obj = new Net::Telnet (errmode => 'return', Binmode =>0);
$tel_obj->buffer_empty;
$tel_obj->input_log($LOG_FILE);
if(!($tel_obj->open($ARGV[1]))) {
print "Unable to telnet...\n";
return 0;
}
$tel_obj->login(Name => $ARGV[2],
Password => $ARGV[3]);
$tel_obj->cmd(String => "cd $SOURCE_PATH");
my $sec = $tel_obj->timeout(99);
print $sec;
my $cmd_str = "perl $ARGV[4]";
$tel_obj->buffer_empty;
$tel_obj->cmd($cmd_str);
$tel_obj->close;
Please help me in solving this issue.
I wrote a perl file to telnet to Windows host using Net::Telnet.
Once I telnet to remote host I execute a perl script.
I am facing the problem with timeout, If I give default time out the
script fails to execute within the time, if I give more time out then
perl script executes but still it will not close the telnet session
until the time out reaches.
Below is the script
my $tel_obj = new Net::Telnet (errmode => 'return', Binmode =>0);
$tel_obj->buffer_empty;
$tel_obj->input_log($LOG_FILE);
if(!($tel_obj->open($ARGV[1]))) {
print "Unable to telnet...\n";
return 0;
}
$tel_obj->login(Name => $ARGV[2],
Password => $ARGV[3]);
$tel_obj->cmd(String => "cd $SOURCE_PATH");
my $sec = $tel_obj->timeout(99);
print $sec;
my $cmd_str = "perl $ARGV[4]";
$tel_obj->buffer_empty;
$tel_obj->cmd($cmd_str);
$tel_obj->close;
Please help me in solving this issue.