As a longtime mdadm user is was just experiencing a disk error and remembered that I configured a Auto Mail reporting for mdadm on disk errors.
Therefore i just had to insert my Mail address inside /etc/mdadm/mdadm.conf
MAILADDR [email protected]
But I really missed that one out on FreeBSD. And as my ZFS RAID6 is now running over half a year i thought of what would happen if a disk would experience a failure?
I never configured any external mail address. Is there an easy way to accomplish and test this?
Like on mdadm:
sudo mdadm –monitor –scan –test
And how would i do it on Linux with ZoL (ZFS on Linux)?
EDIT: Sorry i meant AUTOMATED Reporting. not scheduled.
I know i could have build a script and parse zpool status -X every minute. but I think this is not a very elegant approach of accomplishing the reporting problem. It would be better to be notified instantly on a disk failure (like mdadm)
EDIT[2]: Thank you for your advices, but no im stuck with some scripting issues, fould someone help me with my for loop problem in /bin/sh here -> PASTEBIN
EDIT[3]: Got my for loop problem. :) (update in PASTEBIN)
Any more advices for my script?
Run a regular script (cron) that checks
zpool status -x
output. Longer-term, the ZFS on Linux project is working towards this in the form of an event daemon. The Solaris-derived systems had access to the Fault Management Architecture.As far as automated reports, even commercial solutions like NexentaStor use scheduled checks. There's nothing wrong with that.
Something like this:
Versus something awful like:
Try zfswatcher, it works really well for me.