Skip to content

Instantly share code, notes, and snippets.

@rm1138
Last active March 12, 2021 08:57
Show Gist options
  • Save rm1138/7d3d0e51fc5eb3956cdcb3c75bc80b30 to your computer and use it in GitHub Desktop.
Save rm1138/7d3d0e51fc5eb3956cdcb3c75bc80b30 to your computer and use it in GitHub Desktop.
ZFS pool status checker, use this with cron job and healthchecks.io. The first argument is the number of pool in your system.
#!/bin/sh
ONLINE_COUNT=`zpool status | grep 'state: ONLINE' | wc -l`
if [ "$ONLINE_COUNT" = "$1" ]
then
exit 0
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment