A full zpool status is long, and most days all I want to know is whether anything is wrong. The -x flag turns it into a yes or no question.
zpool status -x
The docs say it only displays the status of pools that are exhibiting errors or are otherwise unavailable. When every pool is fine, the OpenZFS source prints a single line:
all pools are healthy
That makes it easy to use in a script or a scheduled job:
zpool status -x | grep -q 'all pools are healthy' || echo 'check ZFS'
The pipe stays quiet while everything is fine and prints your message when something is not. Wire the echo to a mail or a notification of your choice.
A few related flags are in the current OpenZFS man page. -e shows only unhealthy vdevs, which are the ones that are not ONLINE or that have errors. -g prints vdev GUIDs, usable in place of device names for detach, offline, remove and replace. -s shows the number of slow I/O operations per leaf vdev, which, according to the docs, may indicate a problem with the underlying storage. -j prints the status as JSON, and I’d check that your installed version supports it before relying on it.
There are two caveats. First, the docs state that warnings about pools not using the latest on-disk format are not included with -x, so it won’t nag you about a pending upgrade. Second, a healthy answer says nothing about a scrub. A running scrub or resilver shows its progress and estimated time in the normal output, so use plain zpool status when you want that.
Further reading: zpool-status(8), OpenZFS documentation