From owner-freebsd-questions@FreeBSD.ORG Thu Mar 5 23:24:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF1F31065670 for ; Thu, 5 Mar 2009 23:24:16 +0000 (UTC) (envelope-from modulok@gmail.com) Received: from mail-fx0-f158.google.com (mail-fx0-f158.google.com [209.85.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 56F2D8FC19 for ; Thu, 5 Mar 2009 23:24:15 +0000 (UTC) (envelope-from modulok@gmail.com) Received: by fxm2 with SMTP id 2so151731fxm.43 for ; Thu, 05 Mar 2009 15:24:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0szwfBzriw/3bPTTTXXXsKClg6DDjueUux/cyuTHQoY=; b=w1kx57Hmhr20H4ogOT9p6neN78VHj/RTzGFaptovhWKwhYBFCw4ioYgfkw0PVXJ79p 4r8xNynDoYCdvj5XET/Pe7PtaTsOYJY70b4hm3rsOUzWD8bGQmZUpbDRBgprDe08SzJY QeePNbhetCJa18zcDDgvNeg2pPrtd75q5RdvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tVZiRU6hbwFQBu/SUGlCsrbwiuTYvxnTtE7jQVClTe6CaCVy4Vgn//RpLb5Fzw7aWx M3k65sL/z5uNbjMy6CCCS5JJY7qVRXkTQrE4sCGoz0Ulc25BC9jQO4AThFAlKHvsYSLy BLLya97F/432jlSM4vC6T5e+ZyNAshyC/gAgM= MIME-Version: 1.0 Received: by 10.103.93.18 with SMTP id v18mr783187mul.111.1236295455188; Thu, 05 Mar 2009 15:24:15 -0800 (PST) In-Reply-To: <1236275168.16526.73.camel@phoenix.blechhirn.net> References: <1236275168.16526.73.camel@phoenix.blechhirn.net> Date: Thu, 5 Mar 2009 16:24:15 -0700 Message-ID: <64c038660903051524l71ecead9i321ccb71257d6a9a@mail.gmail.com> From: Modulok To: mister.olli@googlemail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Monitoring geom 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, 05 Mar 2009 23:24:17 -0000 I'm not sure what the 'best' way to monitor a geom is but this should, in theory, work. I wrote it while eating lunch, so obviously it hasn't been tested much and probably contains bugs. If someone, perhaps here on the list, could offer suggested changes (or a better way), that'd be great! Hopefully the indentation won't get screwed up too badly in transit. If so, ask and I can email it as a plain-text attachment. # Script below: #!/bin/sh # DESCRIPTION: # Heartbeat script to check the status of geoms. If a geom is degraded, # This script will email the administrator. # # USAGE: # Place this script in a directory which will be writable by the UID who will # be executing this script via cron. Setup a cron job to execute it at # regular intervals. # # BUGS: # THIS SCRIPT HAS NOT BEEN TESTED! USE AT YOUR OWN RISK! # admin="you@example.com" host=`hostname` subject="Gmirror is degraded on $host" output=`gmirror status` count=`gmirror status | grep -i -c "degraded"` stateFile="gmirror.emailSent" if [ $count -gt 0 ] then # The geom is degraded. if [ ! -w "$stateFile" ] then # Send an email and remember that we sent an email: gmirror status | mail -s "$subject" "$admin" touch "$stateFile" fi fi # The geom is fine, remove the email state file. if [ $count -eq 0 ] then if [ -w "$stateFile" ] then rm "$stateFile" fi fi # End Script It's a thought, anyway. -Modulok- On 3/5/09, Mister Olli wrote: > Hi hi... > > What is the best way to monitor geom software raids (gmirror & gvinum > raid5)??? > > The solution I'm searching for should be a kind of script which checks > the status, and drops me an email if something is wrong. > > I found a nagios plugin, but currently I'm unable to invest enough time > to get nagios up and running for the customer... > > Thanks a lot... > > greetz > Olli > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >