I'm using this library to keep an eye on my backup server, checking what snapshots are on there. Is it possible to see scrub and other health status using this library?
Would you happen to have any hints on how? I don't see anything in the readme on it.
zpool list -o health only gives me HEALTHY, while zpool status gives me scan: scrub in progress since Sat Nov 8 20:05:37 2025 30.7G / 663G scanned at 327M/s, 12.4G / 663G issued at 132M/s 0B repaired, 1.87% done, 01:23:58 to go. That second one is what I'm hoping for.
At present, this tool does not investigate zpool status output so these features would need to be built out from scratch.
As a starter, I'm not sure on how to shape the data returned from a new zfslib API. I would probably look at the actual C code behind zpool status to get an understanding the properties and all the variations of data that it outputs. If they use Enums for various properties then port those over to python. Finally, the tricky part is to find out how to coerce all this dependably from the string outputs.
Hopefully someone has already done this heavy lifting in other languages but I've not yet done any investigating. I built this tool by copying over designs and ideas from existing python based libraries and my own needs around parsing diffs for an in-house, version control system and devops tooling.
Finding any existing OSS tools that automatically monitor zfs scrub and health status would be a great starting point.
I'm using this library to keep an eye on my backup server, checking what snapshots are on there. Is it possible to see scrub and other health status using this library?