Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 89451 invoked by uid 500); 31 Oct 2002 16:00:15 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 89417 invoked from network); 31 Oct 2002 16:00:13 -0000 Received: from alpha.listingbook.com (HELO listingbook.com) (206.27.7.1) by daedalus.apache.org with SMTP; 31 Oct 2002 16:00:13 -0000 Received: from WS4 (ws4.listingbook.com [206.27.7.8]) by listingbook.com (Postfix) with SMTP id 2C0755031B; Thu, 31 Oct 2002 11:19:32 -0500 (EST) Message-ID: <02dd01c280f6$be20b580$08071bce@WS4> From: "Jacob Coby" To: , References: <7713068731.20021031021725@linux.amsjk.de> <02ff01c2807c$7992a970$0201a8c0@atogstad> <5114165148.20021031023541@linux.amsjk.de> Date: Thu, 31 Oct 2002 11:01:15 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: Re[2]: [users@httpd] Testing if a Webserver is down > AST> You could ping the domain in a loop > AST> ping -t > > Yes, I know, but how can I check it with a bash script? > > I pipe the output of the ping comand through grep and count the > returned lines? But I really no nothing about bash-programming! Using ping is a bad idea, it won't give you meaningful results, unless the server is on fire or turned off. I've had a webserver here go down (kernel panic), and it still responds to ping. Bash is really pretty easy to program for, using wget you can do: #!/bin/bash wget -t 1 -T 30 -q www.asdfjklsadfsdf.com if [ $? == 0 ]; then echo 'server is up!'; else echo 'server is down!'; fi ---- from there, it's just a matter of plugging in your own scripts on what to do when the server is down :) Another option is nagios, a daemon that runs on one server and monitors other servers. Comes with a web interface with nice features, and can email or page people responsable for bringing the downed server back up. -Jacob --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org