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

Re: Aw: Re: RAID & Backups



>> 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

-- 
Karl Vogel                      I don't speak for anyone but myself

If you're running out of memory, you can buy more.
If you're running out of time, you're screwed.      --Perl "Camel" book


Reply to: