Posted on 2008-06-06 04:57:11-07 by anan
use Net-Telnet-Cisco to Cisco Terminal Server : successful
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.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.