#!/bin/sh ARRAY=raid0 DRIVE1=wd0 DRIVE2=wd1 MAILTO=mark@geektechnique.org if ! raidctl -s $ARRAY | grep -q 'Parity status: clean'; then raidctl -s $ARRAY 2>&1 | mail -s "`hostname -s`'s Array failed: $ARRAY" $MAILTO fi if ! atactl $DRIVE1 smartstatus | grep -q 'No SMART threshold exceeded'; then atactl $DRIVE1 smartstatus 2>&1 | mail -s "`hostname -s`'s SMART-errors on drive: $DRIVE1" $MAILTO fi if ! atactl $DRIVE2 smartstatus | grep -q 'No SMART threshold exceeded'; then atactl $DRIVE2 smartstatus 2>&1 | mail -s "`hostname -s`'s SMART-errors on drive: $DRIVE2" $MAILTO fi