Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Script stops running.

Script stops running.

From: Nguyen, David M <david.m.nguyen_at_xo.com>
Date: Fri, 08 Feb 2002 09:28:48 -0800
Message-ID: <F001.0040A3EB.20020208083341@fatcity.com>

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: 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US