#!/bin/sh
# /usr/libexec/ctg-azkaban/tmpool-health: exit non-zero (=> unit "failed" => listed in Rustinion host-health
# failed_services, a digest-level signal) when tmpool is missing, not ONLINE, or has errors.
h=$(zpool list -H -o health tmpool 2>/dev/null) || { echo "tmpool not imported/missing"; exit 1; }
[ "$h" = ONLINE ] || { echo "tmpool health: $h"; exit 1; }
zpool status -x tmpool | grep -q "is healthy" || { zpool status -x tmpool; exit 1; }
exit 0
