[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Aw: Re: RAID & Backups



On 9/5/25 02:48, Karl Vogel wrote:
On Thu 04 Sep 2025 at 15:43:32 (-0400), David Christensen wrote:

I am aware of `zfs status`, but I only run it a few times each month.
Is there some kind of automated ZFS pool monitoring tool that notifies
the sysadmin of a failure?

   I'd just run this from cron now and then:

     #!/bin/sh
     export PATH=/bin:/sbin:/usr/bin

     host=$(hostname)
     admin='you@preferred.mail'
     zpool status -x | mailx -s "Zpool status for $host" $admin
     exit 0

   If you can do without constant "EVERYTHING'S FINE!" messages:

     #!/bin/sh
     export PATH=/bin:/sbin:/usr/bin

     host=$(hostname)
     admin='you@preferred.mail'
     pat='all pools are healthy'

     if zpool status -x | grep "$pat" > /dev/null; then
         logger -t 'zpool' "$pat"
     else
         zpool status -x | mailx -s "Zpool status for $host" $admin
     fi
     exit 0


Thank you for posting that script.  :-)


David


Reply to: