modulok at gmail.com
Thu Mar 5 15:24:17 PST 2009
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:
# Heartbeat script to check the status of geoms. If a geom is degraded,
# This script will email the administrator.
# 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.
# THIS SCRIPT HAS NOT BEEN TESTED! USE AT YOUR OWN RISK!
admin="you at example.com"
subject="Gmirror is degraded on $host"
count=`gmirror status | grep -i -c "degraded"`
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"
# The geom is fine, remove the email state file.
if [ $count -eq 0 ]
if [ -w "$stateFile" ]
# End Script
It's a thought, anyway.
On 3/5/09, Mister Olli <mister.olli at googlemail.com> wrote:
> Hi hi...
> What is the best way to monitor geom software raids (gmirror & gvinum
> 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...
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions