6

I couldn't access my media drive the other day. SSH'd into my media server to see what was up. ZFS pool wasn't even mounted. When I got it running again, I saw that it was degraded and one of the harddrives was UNAVAIL.

Got it fixed now, but I'd like an earlier warning if this happens again. Can I get it to send me an email when a harddrive goes offline/degraded/unavailable?

Presently running ZFS 0.6.5.6 on Ubuntu 16.04.2.

mpen
  • 513

1 Answers1

6

You can (and should) monitor your pool via zed, the ZFS event daemon

Alternatively, you can configure cron to regularly run zpool status -x, sending email when some output is printed. For example:

#!/bin/bash
exit_code=0
/usr/sbin/zpool status -x | grep -v "all pools are healthy" && exit_code=1
exit $exit_code
shodanshok
  • 52,255