Ask a Question related to PERL Beginners, Design and Development.
-
Ajit P Singh #1
Query on the telnet module
I had a very urgent query on the telnet module. I tried finding the
information on the net but came up blank on the same. I am a very recent
freebie and I would really appreciate it if you can help me out here. This
might be a very simple problem, pardon my ignorance but u will really save
me a lot of time if you help me out...
---------------------------------------------
Problem Description
I am trying to telnet to a server who sends me a whole bunch of information
(contained in the motd file )which is followed by the login/password prompt.
I login to the server and after login the server sends me a user specified
prompt W9-TEST-01.
After this prompt is sent by the server I send across a series of commands.
Unfortunately I am not able to capture the above mentioned string and then
issue the commands. I have detailed my program below for your convenience...
I tried using the Prompt option in the Telnet call and also in the Waitfor
call too without any success..
Any help would be very appreciated..
----------------------------------------------------
#!/usr/bin/perl -w
use Net::Telnet ();
$inlogfileg = "./inlog";
$outlogfile = "./outlog";
$dmplog = "./dmplog";
$secs = 30;
print "Before telnet creation \n";
$t = new Net::Telnet (Timeout => 10,
Input_log => $inlogfileg,
Output_log => $outlogfile,
Telnetmode => 1,
dump_log => $dmplog,
Timeout => $secs);
# Prompt => '/[W9-BAS-01\>]/');
$t->open("hostname");
#
$t->login("test","test123");
$t->waitfor('W9-BAS-01\>');
#print $t->cmd('test');
#$t->cmd("exit");
#$t->print("enable");
#print " After the login command is sent \n ";
$t->close;
----------------------------------------------
Ajit P Singh Guest
-
How do you telnet from 1 host to another using Telnet Module
Hello, I need to know how you telnet from one host to another using the net::telnet module. I can telnet to a single host OK but I need to then... -
Telnet Module or stopping processing
Hello Before everything, i'll explain the aim of my program: I Admin an Ham radio server that give to ham radio throw an Telnet protocol... -
Module namespace query
I would like to upload a module I've written to CPAN. I've got a PAUSE account, but I need to work out a module name. It's an interface to the... -
telnet module
hey guys/gals i need to telnet to a machine and get a file and split it up into a couple chunks. the problem is that the machine that i'm using... -
New Module: Query Parser
I've floated this question to a few others in the world of Perl without coming up with a definitive answer, so I'm floating it here now. I have...



Reply With Quote

