Subject: amrctl and notification mails
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 07/31/2006 12:55:27
Hi,
Are you getting any notification if a physical disk goes offline for what ever
reason (breaks down, is pulled out, etc) with your amr controller?
I wrote a simple script which is executed every 30 minutes so I should get
notification if something horrible happens in our server. This requires the
latest netbsd-3 or -current installation. Remember to recreate your device nodes
as you need the /dev/amr0 device.
#!/bin/sh
#
# Author: Martti Kuparinen <martti.kuparinen@iki.fi>
#
# $Id: raid.sh,v 1.1 2006/07/31 09:43:07 martti Exp $
#
if [ ! -x /sbin/amrctl ]; then
exit 0
fi
if [ -f /var/run/amrctl.log ]; then
mv /var/run/amrctl.log /var/run/amrctl.log.prev
/sbin/amrctl stat -g > /var/run/amrctl.log
if [ ! -z "`diff -q /var/run/amrctl.log.prev /var/run/amrctl.log`" ]
then
echo ""
echo "WARNING: Change in the RAID status!"
echo ""
diff -u /var/run/amrctl.log.prev /var/run/amrctl.log
echo ""
fi
else
/sbin/amrctl stat -g > /var/run/amrctl.log
fi