logo       

Re: ping check bug?: msg#00177

sysutils.backup.backuppc.general

Subject: Re: ping check bug?

Paul Fox writes:

> i see that there's code in CheckHostAlive to do an initial
> "wakeup" ping, before a second "real" ping. this should help
> my situation. unfortunately, the code as written returns from
> CheckHostAlive immediately upon an error return from the
> execution of $pingCmd, even for the initial wakeup ping. this
> renders the wakeup ping useless -- we'll never try the second
> ping. the fix is simply to remove the "return -1" from that
> clause:
>
> #
> # Do a first ping in case the PC needs to wakeup
> #
> $s = $bpc->cmdSystemOrEval($pingCmd, undef, $args);
> if ( $? ) {
> print(STDERR "CheckHostAlive: first ping failed ($?, $!)\n")
> if ( $bpc->{verbose} );
> # fall through (was "return -1;")
> }

My original intent was to get a more accurate round-trip time by
doing two pings and timing just the second ping. So I consider
a first ping failure as fatal.

But I'm ok making this change.

> that's makes it much better, but it's not quite enough for my
> situation -- it always seems to take at least two "icmp redirect"
> responses before the pings start going to the right place. this
> means that the single wakeup ping isn't enough -- i need at least
> two. i've added another wakeup ping before the final ping (three
> altogether) and this seems to be reliable.
>
> so, a request: can that code be changed to make multiple
> attempts to ping the host, rather than just two? i'm thinking a
> loop that tries, say, 10 times, before giving up. that'd be a
> lot more robust...

I would rather not do it 10 times, since, for example, a DHCP
pool search would be a lot slower.

I recommend simply writing your own shell or perl script that does
several pings and point $Conf{PingCmd} at your script.

Craig


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
BackupPC-users mailing list
BackupPC-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise