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
==============================================================
#!/usr/local/bin/perl -w
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).