From owner-freebsd-questions@FreeBSD.ORG Thu Sep 4 19:07:12 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980411065670 for ; Thu, 4 Sep 2008 19:07:12 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.freebsd.org (Postfix) with ESMTP id E6FEF8FC19 for ; Thu, 4 Sep 2008 19:07:11 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so40264nfh.33 for ; Thu, 04 Sep 2008 12:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=b0Tkmipo/4Pn3zReechK98IRtr2KoXHahpjDSDM5Q8w=; b=bp2Oe0Oo7e+BrIjfcyU1dGwSY80z5BcNkKjVOSs4X+8NvbGal3gWVVXxM4amEMFsju nPULeq15WUikSjt/AsVu/h4JWdVb3lm/sksJEvZyTnOCer2b7qZB0xDshWpVg7Dsz+gm t5MKk/fTxFaNd1IVkyjbvRLn3YNR/KtQemIew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=q/iY95gavOIMblziB9vbM8JF1rdZrrJBJ5RfS7C+kewQrdDQ/FoNlP82GZb0KV8ak4 ZUFYBGwK2YuJf5E8zofZ88WcmYLdP8eE/IUfHo7mbyNO8bKDzd85l6lnXs2a8L4yd1y5 eiR6ILGCPWFY0sn56Q6mGQjJABZ7a9KAkilFc= Received: by 10.187.195.7 with SMTP id x7mr2480085fap.46.1220555230284; Thu, 04 Sep 2008 12:07:10 -0700 (PDT) Received: by 10.187.205.5 with HTTP; Thu, 4 Sep 2008 12:07:10 -0700 (PDT) Message-ID: Date: Thu, 4 Sep 2008 21:07:10 +0200 From: "Redd Vinylene" To: questions@freebsd.org In-Reply-To: MIME-Version: 1.0 References: <2620c3260808301722s673f70dkab7590f1ed9e48a4@mail.gmail.com> <48BAB1C1.8020802@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: How to test the uptime of a webserver? 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, 04 Sep 2008 19:07:12 -0000 On Thu, Sep 4, 2008 at 9:05 PM, Redd Vinylene wrote: > On Thu, Sep 4, 2008 at 8:58 PM, Redd Vinylene wrote: > >> >> On Sun, Aug 31, 2008 at 4:59 PM, Matthew Seaman < >> m.seaman@infracaninophile.co.uk> wrote: >> >>> Redd Vinylene wrote: >>> >>>> On Sun, Aug 31, 2008 at 2:22 AM, Moises Castellanos >>>> wrote: >>>> >>>>> >>>>> On Sun, Aug 31, 2008 at 7:05 PM, Redd Vinylene >>>> > >>>>> wrote: >>>>> >>>> >>> I got this dedicated server which is exposed to DDoS attacks quite >>>>>> frequently. Say I need to host a website on it, is there any way of >>>>>> telling how often it is actually online (to the rest of the world)? >>>>>> >>>>>> Maybe make some sort of ping script from a remote server? >>>>>> >>>>> >>> You can install nagios and monitor the web server. It will send you >>>>> an >>>>> email when >>>>> the server is down and when is up again. With this information you can >>>>> know >>>>> the uptime >>>>> of the web server. >>>>> >>>> >>> I'd have to install Nagios on a different server then, right? I doubt >>>> the actual server knows when its ISP's link drops (or just slows down) >>>> due to an attack. >>>> >>> >>> Not necessarily. You can install nagios on your web server and use it >>> to monitor a server at the other end of your wan link -- usually a >>> machine in your ISPs infrastructure[*] -- on the basis that if you can >>> get packets out, then other people can get packets in. The trick is to >>> monitor something that isn't too far away, or you'll end up monitoring the >>> availability of other people's networks, rather than your own. >>> >>> There's a lot more can be done than just monitoring connectivity by >>> sending ICMP ping packets every so often. There are any number of >>> ways a web server can go wrong -- processes can crash, critical disk >>> partitions can fill up, load spikes can overwhelm the machine's capacity. >>> You can develop a range of different nagios tests that should tell you >>> pretty much at a glance just what has gone wrong. Takes all the fun out >>> of diagnosing the problems perhaps, but it does mean you'll be back to >>> bed sooner when the pager goes off in the small hours. >>> >>> Cheers, >>> >>> Matthew >>> >>> [*] Some ISPs provide machines specifically for this purpose. >>> >>> -- >>> Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard >>> Flat 3 >>> PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate >>> Kent, CT11 9PW >>> >>> >> Thank you guys. I'm looking for the simplest solution though, like a >> simple oneliner, or a shell script. >> >> Anybody have an idea? >> >> -- >> http://www.home.no/reddvinylene >> > > I'll try to write a simple shell script and report back to y'all. > > -- > http://www.home.no/reddvinylene > Perfection is achieved, not when there's nothing left to add, but when there's nothing left to take away :) while sleep 555; do wget http:// -O /dev/null -t 1 || mail -s "" <<< "Host is down"; done -- http://www.home.no/reddvinylene