From owner-freebsd-questions@FreeBSD.ORG Thu Jul 6 15:39:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D9C016A4E1 for ; Thu, 6 Jul 2006 15:39:00 +0000 (UTC) (envelope-from pietro.cerutti@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF86B43D46 for ; Thu, 6 Jul 2006 15:38:59 +0000 (GMT) (envelope-from pietro.cerutti@gmail.com) Received: by ug-out-1314.google.com with SMTP id m3so344206uge for ; Thu, 06 Jul 2006 08:38:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XXCLWP25mM2xuWeWV68G96zLPs0FYhI8LrHFpw6NLXybbBpx69gVaSrIxT2DjCveO/29US7a6gjtvQsCimDPxLtxRoviy4pX5khcktk1fFp7LyHUF6THVDnOmkrS1Bjnw3tLCNV0WX/BAgRE4EuJR9uOmL0ofZ58kBGadi2YLqY= Received: by 10.67.19.13 with SMTP id w13mr865655ugi; Thu, 06 Jul 2006 08:38:58 -0700 (PDT) Received: by 10.67.23.8 with HTTP; Thu, 6 Jul 2006 08:38:58 -0700 (PDT) Message-ID: Date: Thu, 6 Jul 2006 17:38:58 +0200 From: "Pietro Cerutti" To: "Paul Hamilton" , "freebsd questions" In-Reply-To: <032f01c6a10e$494e4c40$6600a8c0@w2k2> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <032f01c6a10e$494e4c40$6600a8c0@w2k2> Cc: Subject: Re: using fping to monitor internet connection status X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2006 15:39:00 -0000 On 7/6/06, Paul Hamilton wrote: > Hi, Hallo, > > I need to monitor a number of IP addresses, so that if they ALL go down (say > three IP's), then that is a pretty good indication that my server has lost > internet connectivity. [snip] > Any idea's on a ping tool or simple script? #!/bin/sh err=2 # Ping return value on error ping -c1 host1 > /dev/null 2>&1 host1=$? ping -c1 host2 > /dev/null 2>&1 host2=$? ping -c3 host3 > /dev/null 2>&1 host3=$? if [ $host1 -gt $err -a $host2 -gt $err -a $host3 -gt $err ]; then echo "Network is down..." fi Could surely be refined, but it works ;-) > Regards, > > Paul Hamilton > Busselton, 6280 > Australia > Regards, -- Pietro Cerutti ICQ: 117293691 PGP: 0x9571F78E - ASCII Ribbon Campaign - against HTML e-mail and proprietary attachments www.asciiribbon.org