node-exporter-textfile-collector-scripts
node-exporter-textfile-collector-scripts copied to clipboard
Add zfs_zpool.sh script
Useful for monitoring zpool health, zvolumes, and zfs filesystems which are not mounted
Also zfs-specific stats which can't be seen from node_filesystem metrics (e.g. compressratio)
For whatever it is worth, I use this to track the age of the latest snapshot:
zfs list -Hp -t snapshot -o name,creation \
| sed -e 's#@.*\s# #' \
| awk '
{
if (last[$1] < $2) {
last[$1]=$2
}
}
END {
for (m in last) {
printf "zfs_snapshot_age_seconds{dataset=\"%s\"} %s\n", m, last[m];
}
}
' \
| sponge znapzend-snaps.prom