#!/usr/bin/perl use Net::Telnet (); $host='192.168.1.181'; {$t = new Net::Telnet (Timeout => 10,Input_log => "received_data.txt" , Prompt => '/bash\$ $/'); $t->open($host); $t->print("AT"); #this is just used to make sure it connects## $t->waitfor('/AT/'); #this is just an echo back of what is sent## $t->waitfor('/OK/i'); #send this to say I'm ready## } {$t->print("AT%23=1234"); #This basically the password to the system## $t->waitfor('/AT%23=1234/i'); #Echo back## $t->waitfor('/OK/i'); } { $oid = $t->print("AT1122"); #This is the command to see the state## $oid = $t->waitfor('/AT1122/i'); #Echo back## $oid = $t->waitfor('//'); #this could be 0,1,2...need to converto oid### #Need this value to check state in SNMP## $t->waitfor('/OK/i'); } $t->close();