I would like to know if there is a way to access the ZFS api (preferably from python but C is fine too). My goal is to write some tools that will monitor my pools but would definitely like to not to have to parse output of zpool command.
There are java bindings to the libzfs on Solaris. AFAIK they haven't been ported (yet) to BSD or Linux. However, it might not be too big of an endeavour to start that, since it is Java after all, it could be relatively portable already.
IIRC the Java API was used for Solaris 10's ZFS Management Web Interface.
Also, I've heard rumors about a Python API (perhaps it was used in the new-style Autosnapshot service by Tim Foster?).
Here is a link to the latest bits I knew how to find
Additionally if you are using OpenZFS (ie. ZFS on Illumos, FreeBSD, Linux, Mac OS X, etc.) there is now libzfs_core as alternative to libzfs (which was iirc never a stable API). See: http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With