Hi,
I am Shivageeta S. Choodi, working for Novell, Bangalore in system testing group.
I have used Perl for the test automation. I am facing a problem in telnet module of Perl. The problem details are as follows and the script (around 10 lines) is also attached.
___________________________________________________________
Problem description:
Test machine: Running the script from a SLES 8 machine
The script : is attached. It does telnet to a machine (hard coded in the script), and a create a file /my-Perl after the successful telnet.
Problem: If the host specified in the script is SUSE/SLES machine, the script hangs. But the same script works fine if I change the host to some other Unix/Linux hosts for example RH Linux/Solaris. I am also able to manually telnet to the SUSE/SLES boxes (for which the script is hanging during the telnet operation).
Perl telnet module: Net-Telnet-3.03
___________________________________________________________
The Code:
#!/usr/bin/perl
#use Time::Format;
BEGIN
{
push(@INC,'/usr/lib/perl5/site_perl/5.8.0/URI/');
}
require "Telnet.pm";
#Initialise telnet
$telnet = new Net::Telnet->new( Timeout=>20,Prompt => '/[\$%#>] $/');
die &Log_Message("Can't open telnet session to the remote host") unles
+s $telnet;
#Telnet and login to a remote machine
$telnet->open("systst-lnx-15");
$telnet->login("root","novell");
print "Logged into the system \n";
#After a successful telnet create the file /my-perl at the remote host
+.
$telnet->cmd("touch /my-perl");
$telnet->close;
_______________________________________________________
Can you please let me know is there any problem with the perl telnet module which have installed?
I request you to help me in solving this problem (i.e. the script should be able successfully telnet to a SUSE/SLES machine and create a file).
With Regards,
Shivageeta
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.