ZFS pool actual usage information

CMK version: 2.2.0p21
OS version: TrueNAS SCALE 23.10.2

I am currently trying to get the actual usage information (used/available) of ZFS pools from my TrueNAS SCALE machine.

The existing storage pool integration (check_mk-zpool) shows information from zpool list which is correct but does not show the logically used/available space but the physical one.

I would like to monitor the actual used/available parts of the usable pool capacity similar to the depiction in TrueNAS’s UI.

The checkmk-Agent has the following section:

section_zfs() {
    if inpath zfs; then
        echo '<<<zfsget:sep(9)>>>'
        zfs get -t filesystem,volume -Hp name,quota,used,avail,mountpoint,type 2>/dev/null
        echo '<<<zfsget>>>'
        echo '[df]'
        df -PTlk -t zfs | sed 1d
    fi
}

This section generates the correct output with its zfs get call under <<<zfsget:sep(9)>>>.
I checked my agent output which includes the section:

<<<zfsget:sep(9)>>>
boot-pool       name    boot-pool       -
boot-pool       quota   0       default
boot-pool       used    12938743808     -
boot-pool       available       93193580544     -
boot-pool       mountpoint      none    local
boot-pool       type    filesystem      -
[...]

This section includes all the data I want (and more, I only need the top level but this lists all filesystems and volumes).
It seems to me, that my checkmk instance ignores this data.
I cannot find the data from this section.
Instead the output of the second statement of the agent section above (the output of df -PTlk -t zfs | sed 1d) seems to get used.

I have the strong feeling of just doing something wrong but I searched through the (pretty long) list of all the filesystems that I get reported and I could not find the data.

I also tried commenting out the df-part of the zfs-section in the checkmk agent which resulted in all the Filesystem services vanishing. This led me to believe, that the other part of the section gets completely ignored.

Any idea how I can get the data to show up?

The zfsget section and its check plugin (also named zfsget) creates service checks that are named starting with “Filesystem”. But only for mounted ZFS filesystems.

I am aware of that. As I wrote above I do see those services but they seem to be only generated from the first call in the zfs section of the agent while the second one’s output seems to be ignored.

I’ve now cicrumvented the issue by writing a local check which produces <<<df_v2>>> output from zfs get after I took a closer look at the server side plugin.