#!/bin/bash # # KISS: Keep It Simple, Stupid! # # Just a fast md5sum check on /proc/mdstat to see # if something changed in this quite important file # # Initialize this script feeding the file with the sum when # the RAID is really UP: # md5sum /proc/mdstat > /root/scripts/data/mdstat_checksum # and then call it hourly with cron # If something is wrong you will recive a mail hourly until you # fix the problem # # # Do anything you like with this but DO NOT call me for ANY problem # :-) # # pit at asashi a dot net site # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. if md5sum -c /root/scripts/data/mdstat_checksum &> /dev/null then exit 0 else echo "Message from root@example.com" echo "md5sum check on /proc/mdstat FAILED!" echo "software raid @ host.example.com may be down" echo "Check it NOW please!" exit 1 fi # # vim:tabstop=3:expandtab:shiftwidth=3:textwidth=80:autoindent #