logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Need help: msg#00320

Subject: Re: Need help

> > From:       Najamuddin, Junaid[SMTP:JUNAID.NAJAMUDDIN@xxxxxx]


It is not ideal but will count each fail and if it reaches three it
will execute whatever you want. I think you can change ping to only
ping so many times. Hope it helps.


#!PERL

use strict;
use warnings;

my  $count = 0;
my $line;
my @out;

@out = `ping 192.168.210.1`;

foreach $line (@out)
        {       
        if ($line =~ /.*Request timed out.*/)
        {
        ++$count;       
        }

        if ($count > 3 ){
        
        print STDOUT "CODE GOES HERE TO SEND MAIL";
        
        }

};


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>