ZFS zpool mirror Monitoring
-
pfSense has been supporting ZFS for some time now and I'm very happy with it, especially the fact, that I can setup a mirror of two disks on physical installations.
Yet I miss an option to monitor the health of such a setup. Does pfSense itself send out notifications if it detects zpool failure similar like TrueNAS does?
Even if it does, I think integrating it into the monitoring would be more ideal, since you can acknowledge and silence during a maintenance, you get what I mean.
Currently I'm thinking about putting this script onto every host and utilize it with Nagios, but the script won't be included in a backup config file, right?
What is best practice for this topic?
-
@pmisch pfsense and truenas are two different things. One is fire-walling and the other is storing. Don't forget 2.5 ++ version is quite unstable, but sure you can always try it. Make sure to do a backup.
-
When we move to ZFS as the default file system we will almost certainly use it for multi drive systems too. At that time the existing GEOM mirror functionality would need to be replicated for ZFS mirrors. It's something we're looking at doing anyway.
Steve
-
@pmisch
I did this to monitor, but no notifications:
https://forum.netgate.com/topic/155349/where-to-view-the-status-of-a-zfs-mirror/5?_=1620467813682 -
Nice.
-
@stephenw10 High praise! :)
-
In the end I wrote a very tiny shell script to check the ZFS status and put it into
/usr/local/libexec/nagios/check_zfs_status.sh
#!/bin/sh cmdzpool="/sbin/zpool" healthcheck=`$cmdzpool status -x | grep -c "all pools are healthy"` if [ $healthcheck -eq 1 ] then echo "ZFS Volumes OK" return 0 else echo "ZFS Volumes error." return 2 fi
It's not the ideal solution since the check has to be installed manually but it's better than nothing.