*BSD News Article 74182


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!oleane!jussieu.fr!math.ohio-state.edu!usc!hookup!news.mathworks.com!uunet!in2.uu.net!betty.bway.net!kives
From: kives@bway.net (Stephen Kives)
Newsgroups: comp.sys.sun.admin,alt.sys.sun,comp.unix.bsd.misc,comp.unix.programmer,comp.unix.bsd.bsdi.misc,comp.unix.admin
Subject: Re: ping script
Date: Fri, 19 Jul 1996 00:14:26 -0400
Organization: bway.net, part of Outernet, Inc. in New York City
Lines: 25
Message-ID: <kives-1907960014260001@news.bway.net>
References: <Pine.SOL.3.93.960702171209.4062B-100000@gold.acns.fsu.edu> <31DA8A95.61BB@hybrid.com> <4rjo9o$gn@anorak.coverform.lan> <Pine.GSO.3.93.960715213545.21927D-100000@delta.ds2.pg.gda.pl>
NNTP-Posting-Host: dial64.bway.net
Xref: euryale.cc.adfa.oz.au comp.sys.sun.admin:70824 alt.sys.sun:10424 comp.unix.bsd.misc:1258 comp.unix.programmer:39758 comp.unix.bsd.bsdi.misc:4338 comp.unix.admin:45075

In article <Pine.GSO.3.93.960715213545.21927D-100000@delta.ds2.pg.gda.pl>,
Alan Ghafour <alan@delta.ds2.pg.gda.pl> wrote:

> On 5 Jul 1996, Brian Somers wrote:
> > : Use two pings just because of routing issues, the 
> > : first ping may get an error.  The second ping will 
> > : verify that the node is really missing.
> > 
> > Despite the return code on FreeBSD being correct, historically, it is not
> > guaranteed.  If you want to write a portable script, don't do it this way.
> > 

I strongly recommend getting the "fping" utility off the net.  It works 
beautifully, giving the correct return codes without a problem.  It will, by
default try a given address three times before giving up.  It also has a 
provision for taking target addresses from a file or standard input.

The best feature, IMHO, is the time-out specification.  The standard 10-second
timeout of most "ping"s out there is grossly unuseable for this purpose.  By
setting the timeout to "-t1000" for a thousand milliseconds, you can get a
reliable determination that a given host is truly "dead" before reporting it
as so.  (This assumes your target hosts are well connected, not subject to
one-second roundtrips normally.)

Steve Kives