if (`ping $blade` =~ /$badPing/) {print "$blade:
$badPing\n";}

change to:

my @results=`ping -c1 $blade`;
print "$blade:$badPing\n" if grep /$badPing/,@results;





On Fri, 9 Sep 2005 01:41:19 -0700 (PDT), "Christopher Spears"
<[EMAIL PROTECTED]> said:
> I've decided to rework my Perl script that pings a
> blade and checks for nrnode:
> 
> my @bladeNumbers = @ARGV;
> 
> if (scalar @bladeNumbers == 0) {
>     print "No blades entered!\n";
>     exit;
> }
> 
> foreach $_(@bladeNumbers) {
>    my $blade = "blade-".$_; 
>    print "$blade\n";
>    my $badPing = "Destination Host Unreachable";
>    if (`ping $blade` =~ /$badPing/) {print "$blade:
> $badPing\n";}
>    my $nrnode = `ssh $blade ps aux | grep nrnode`;
>    if ($nrnode =~ /nrnode/) {print "Found nrnode for
> $blade!\n";}
> }
> 
> The problem line is:
> 
> if (`ping $blade` =~ /$badPing/) {print "$blade:
> $badPing\n";}
> 
> How do I go about finding out if the blade I ping is
> not sending back the packets?  From what I can gather,
> ping returns a success regardless of whether or not
> packets are received.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
-- 
  Jeff Pan
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - Access all of your messages and folders
                          wherever you are


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to