Re: Monitoring Software Configuration for Debian server.
On Fri, Jan 18, 2008 at 11:34:43PM -0500, Andrew Syrewicze wrote:
> Right, I've got Smartmontools installed and working just fine, as well mdadm
> working for my array.
>
> Can these tools be configured to send alerts to a local mail account??? And
> from there be mailed to external mail addresses via something like
> sendmail???
>
> If so how do I go about configuring smartmontools and mdadm for alerts??
Where does root mail go now?
/etc/mdadm.conf
has the line
MAILADDR root
If your mail is set so that you get root's mail, then you will get mdadm
mail.
I have this little script called drivestatus that I put in
/usr/local/sbin:
8>--
#! /bin/sh
# PROGRAM /usr/local/sbin/drivestatus
# 2007-01-06 Doug Tutty
/bin/echo "Runs all drive and array status commands."
/bin/echo
/bin/echo "/dev/sda:"
/usr/sbin/smartctl -a -d ata /dev/sda
/bin/echo
/bin/echo "/dev/sdb"
/usr/sbin/smartctl -a -d ata /dev/sdb
/bin/echo
/sbin/mdadm -D /dev/md0
/sbin/mdadm -D /dev/md1
8>--
This gives me the current status.
I also have this script that cron runs weekly but I can run anytime:
8>--
#! /bin/sh
# PROGRAM /usr/local/sbin/drivecheck
# 2007-01-06 Doug Tutty
#
# Runs programs to monitor drive and array status weekly.
# Some packages put cron jobs to do this in the middle of the night,
# but this computer is turned off overnight. Anacron takes care of this file.
/bin/echo "Initiate a long S.M.A.R.T. selftest on /dev/sda,"
/bin/echo "waits 40 minutes and then on /dev/sdb:"
/bin/echo "waits 40 minutes and then checks the md arrays."
/bin/echo "Watch progress and results with:"
/bin/echo "/usr/sbin/smartctl -a -d ata /dev/sda"
/bin/echo "/usr/sbin/smartctl -a -d ata /dev/sdb"
/bin/echo "/sbin/mdadm -D /dev/md0"
/bin/echo "/sbin/mdadm -D /dev/md1"
/bin/echo "Or just use /usr/local/sbin/drivestatus|less"
/usr/sbin/smartctl -t long -d ata /dev/sda
sleep 40m
/usr/sbin/smartctl -t long -d ata /dev/sdb
sleep 40m
/usr/share/mdadm/checkarray -a
8>--
I hope this helps.
Doug.
Reply to: