Setting up an email alert when ZFS disk fails on FreeNAS

6,466

Solution 1

One think I can think of right now is having a cron job periodically run a command like zpool status -x and check to see if it returns anything other than all pools are healthy. If so, then it would fire off an email. (Unfortunately, I'm still learning things so I can't write the script myself, but I've been looking for someone who has.)

Another thought is have the status report get emailed emailed to you and have your email program look for key words like "checksum mismatch" because zpool errors will show up in those logs.

Unfortunately, I don't believe there is a built in Email Alerts for anything, which is a little surprising. I never looked for them before, but I kind of expected them there after setting up my ReadyNAS. Not only will it alert me of a drive failure/failing (increase in sectors being swapped out), but if a drive fails and my data is at risk, it will shutdown to protect the data.

Solution 2

Not directly ZFS-related, but you can get FreeNAS to email you based on SMART parameters, if that would help...

Disks|Management|SMART

Share:
6,466

Related videos on Youtube

Olof Åkesson
Author by

Olof Åkesson

Updated on September 17, 2022

Comments

  • Olof Åkesson
    Olof Åkesson almost 2 years

    I am trying out FreeNAS 0.7.2 Sabanda (revision 5226) with 4x1TB disks, single parity ZFS RAID.

    While the email reports built into FreeNAS are good, I was wondering if there was a way I could get it to email me immediately if a disk fails or does anything suspect, since I can only tolerate a single disk failure.

    Any ideas gratefully received.

    (note: reposted from superuser.com on the recommendation of a commenter over there)