|
Hi All
Just tell everyone if you have the problem same with me when using Net::Telnet::Cisco interactive to Cisco terminal server perl script will death after Net::Telnet::Cisco connect to Cisco 2509 termininal server . Coz of the problem is script waitting "Enter Newline" it will give error command time out. So if you have same this problem just follow my script .
#======== Successful perl script ========
$cs_m = Net::Telnet::Cisco->new( Host => "192.168.0.1" ,
Input_Log => "$Log_input_m",
Port => "2001",
Output_log => "$Log_output_m",
Timeout => 100 );
sleep 2 ; ## below line with "^M" is special charector just press Ctrl+v+m
$cs_m->print('^M');
$cs_m->login('anan','test');
$cs_m->enable('pass_enable');
$cs_m->cmd('term length 0');
$cs_m->cmd('show ver');
$cs_m->cmd('show run');
## =====
#
# You look at line with ^M
# "^M" is sepecial charector press Ctrl+v+m by vi editor it not same press ^M by press ^ and M
#===
Thanks
Anan P.
Jasmine Internet
Thailand. |