NET::TELNET and displaying output on-screen

Z

ZoloftGuy

I'm a newbie to Perl and I am writing a script to telnet in an shut
off one of our Nortel Contivity VPNs. It works but, I'd like some of
the activity to display on the screen rather then just in the logs.

Is there anyway to do this? Here is the script. Please tell me if
there is anything back-asswords about it. Thanks:

$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');

# Contivity
system "cls"; #This clears the screen.
print "Ok, First, lets shut down the Contivities\n";
$t->open("contivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("pass");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("pass");
$t->print("shutdown -h");
$t->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output1 = $t->cmd('y');
print @output1;
$t->close;
 
C

Charles DeRykus

I'm a newbie to Perl and I am writing a script to telnet in an shut
off one of our Nortel Contivity VPNs. It works but, I'd like some of
the activity to display on the screen rather then just in the logs.

Is there anyway to do this? Here is the script. Please tell me if
there is anything back-asswords about it. Thanks:

$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');

$t = new Net::Telnet ( ... , input_log =>\*STDOUT);

(dump_log provides even more detail)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top