Mar 19, 2009

perl telnet script

use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt => '/\$|#|%|>/');
$telnet->open('192.168.1.1');
$telnet->login('root','tttt');
print $telnet->cmd('who');
print $telnet->cmd('ps -ef | grep ora_ | wc -l');

0 意見: