From owner-freebsd-questions Mon Dec 17 9:11:15 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.27in.tv (roc-66-24-112-7.rochester.rr.com [66.24.112.7]) by hub.freebsd.org (Postfix) with ESMTP id EB05F37B419 for ; Mon, 17 Dec 2001 09:10:48 -0800 (PST) Received: (from root@localhost) by mail.27in.tv (8.11.6/8.11.6) id fBHHAmq10770; Mon, 17 Dec 2001 12:10:48 -0500 (EST) (envelope-from cjm2@earthling.net) Received: from maxpower (maxpower.lan.27in.tv [10.0.0.250]) by mail.27in.tv (8.11.6/8.11.6av) with SMTP id fBHHAkN10721; Mon, 17 Dec 2001 12:10:47 -0500 (EST) (envelope-from cjm2@earthling.net) From: "C J Michaels" To: "Ryan Thompson" Cc: "BSD Freak" , "FreeBSD Questions" Subject: RE: ping failure script Date: Mon, 17 Dec 2001 12:12:02 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <20011217010314.G15624@blossom.cjclark.org> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Virus-Scanned: by AMaViS perl-11 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Check out fping in the ports. --Chris -----Original Message----- From: owner-freebsd-questions@FreeBSD.ORG [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Crist J . Clark Sent: Monday, December 17, 2001 4:03 AM To: Ryan Thompson Cc: BSD Freak; FreeBSD Questions Subject: Re: ping failure script On Sun, Dec 16, 2001 at 10:26:50PM -0600, Ryan Thompson wrote: > Crist J . Clark wrote to Ryan Thompson: > > > > ping will only fail if no replies are received. > > > The above example could use some better input error handling, > > > but otherwise, it should do what you want. > > > > Nope, ping(1) will never die if it doesn't get the responses. You need > > to add the '-w' option. Something like, > > > > PING="/sbin/ping -q -c 3 -w 10" > > > > Should do it. > > Which ping are you using? ping in 4.4 doesn't appear to support -w. > When I (very briefly) tested this code, it timed out after about 30 > seconds and returned a failure. Oops. s/-w/-t/ You're right though, ping(8) times out now-a-days on its own. Looks like that was added in revision 1.37 (1998/05/25)? -- "It's always funny until someone gets hurt. Then it's hilarious." Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message