Z
ZoloftGuy
The goal is to reboot and or shutdown a Nortel Contivity box with PERL
and the Telnet Script.
use Net::Telnet ();
###Prompt is "$"
$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');
$t->input_log('input.txt');
$t->output_log('output.txt');
$t->open("nortelcontivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("thepassword");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("thepassword");
$t->print("reload restart");
@output1 = $t->cmd('y');
print @output1;
$t->close;
When I issue the reload restart commmand, this message pops up from
the Contivity: (exactly like this, I pulled this from input log.)
%Proceed with reload? (y/n)
I then do this:
@output1 = $t->cmd('y');
print @output1;
$t->close;
It works, the box reboots, but I get this error:
pattern match read eof at C:\temp\yo.pl line 18
Feel free to flame me, I admit, I don't know what the heck I am doing.
Thanks
and the Telnet Script.
use Net::Telnet ();
###Prompt is "$"
$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');
$t->input_log('input.txt');
$t->output_log('output.txt');
$t->open("nortelcontivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("thepassword");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("thepassword");
$t->print("reload restart");
@output1 = $t->cmd('y');
print @output1;
$t->close;
When I issue the reload restart commmand, this message pops up from
the Contivity: (exactly like this, I pulled this from input log.)
%Proceed with reload? (y/n)
I then do this:
@output1 = $t->cmd('y');
print @output1;
$t->close;
It works, the box reboots, but I get this error:
pattern match read eof at C:\temp\yo.pl line 18
Feel free to flame me, I admit, I don't know what the heck I am doing.
Thanks