[WBEL-users] mdadm and mdmpd weirdness
Michiel van Es
info@pcintelligence.nl
Mon, 08 Mar 2004 12:58:28 +0100
Mark Reynolds schreef op 8-3-2004 11:14 het volgende:
>Greetings.
>
>I recall someone asking about the mdadm and mdpd processes before,
>and upon further investigation, seems that they are md / raid
>monitoring daemons.
>
>The idea being that since raid disk setups will silently
>sort themselves out (if setup correctly) on a disk failure,
>would be nice if the server in question sent you an email
>to let you know about a disk failure.
>
>So, suitable init scripts are installed (I think when you
>choose the AS (?) install option on initial install, and
>all you need to do is edit the last email line of
>/etc/mdadm.conf
>
>Problem is, I constantly get
>
>
>
>
[snip..]
>
>Has anybody here gone into this further than me yet?
>Seems that perhaps the /proc/mdstat output has been
>modified, without the matching changes to the md monitoring
>packages.
>
>thanks
>
>
>
I have a simple but trustworthy softraid check script which alerts via
email:
#!/bin/sh
# first initialize
cat /proc/mdstat >/tmp/mdstat.nu
(diff /usr/local/raid-check/mdstat.ok /tmp/mdstat.nu >/tmp/mdstat.diff)
datum=$(date +%D)
# Do your thing
if [ -s /tmp/mdstat.diff ]; then
echo "ALARM.$datum" >>/var/log/raid-alarm.log
/bin/cat /tmp/mdstat.diff | mail -s "** ALERT ** mdstat has changed on
$HOSTNAME" monitoring@domain.com
fi
##################################################################################################
Then you have to do 2 more thing:
-do a (when the raid devices are in a healthy state: cat /proc/mdstat >
/usr/local/raid-check/mdstat.ok
-cron this script to run every * minutes.
Works lgreat!
M.