Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Script stops running.
Hi all,
I get a perl script to telnet to several machines on network to check something I want to check. When it trys to connect a machine which is down, the script will stop running. How do I tell it to continue to check the next machine and ignore the one down?. Below is my script.
Thanks,
David
use Net::Telnet;
%city = qw(host1 passwd
host2 passwd host3 passwd host4 passwd );
$telnet = Net::Telnet->new
(
Timeout => 10,
Input_log => 'PSXreplication.log',
Prompt => ('/[%:] $/'),
);
foreach $key (sort keys %city) {
$telnet->prompt("/$key%/i");
$telnet->open("$key");
$telnet->login('ssuser', "$city{$key}");
$telnet->prompt("/$key%/i");
$telnet->cmd('ls -l');
print "=============================================================\n\n";
$telnet->close("$key");
}
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nguyen, David M INET: david.m.nguyen_at_xo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Feb 08 2002 - 11:28:48 CST