-
Problem report
-
Resolution: Done
-
Major
-
None
-
6.0.32, 7.0.1, 7.2.0alpha1
-
None
FreeBSD 14 14.0-RELEASE-p6
zabbix7-agent-7.0.0
Template - FreeBSD by Zabbix agent
Hello
The whole approach of reading and displaying ZFS data in this template is wrong.
It's not useful in case that my ZFS pool goes to 80% it will never know that.
Current Value displayed in Zabbix used by my pool called backup-pool is 96K. Of course this is wrong because pool is using 1.5T and is about 50% full.
The value used to read the used Disk space is the wrong one. USEDDS is used, as it shows 96K. This value shows only the data used by files in the /backup-pool/ directory or backup-pool dataset but this excludes snapshots, reservations, child datasets etc... There is only one folder in /backup-pool/ which is also a dataset which is mounted to that directory.
Instead of the value USEDDS, the value USED should be used. This value shows how much Data is actually on the pool.
An extra info could be added for the actual files provided by USEDDS, but it shouldn't be used in the formula.
What is correct is the AVAIL value which shows the Available Space on the pool, it is 1.72
Available and Total are the same value, which is incorrect, unless Total means Total Available, but it probably doesn't because you wouldn't put the same value under a different label.
What is Total?
If you meant the Total size of a Disk, that isn't important in ZFS.
The total value of a ZFS pool can be seen in `zpool list` under SIZE. This also woudn't be correct as the size of the pool isn't available, it's the size of the Disks. In my case SIZE is 3.62T but the actual Total pool size is 3.51 TB.
Then I guess you were looking for the Total size of the pool? That formula would be AVAIL+USED from the zfs list -o space command. In my case that's 3.51T
So 1.72 is 50.99 of 3.51T which is the Used space. The real used space of the pool including the child datasets and their snapshots and their files etc.
Available Disk space percentage should have been 49%
So to summarize in order in which it appears in Zabbix, the values should be:
Total: 3.51 TB (100%)
Used: 1.72 TB (50.99%)
Available: 1.72 TB (40%)
Instead the values are
Total: 1.72 TB (100%)
Used: 96K (0%)
Available: 1.72 TB (100%)
Also reading ZFS values is valuable when it's done in a ZFS way, not in a du and directory type of way.
What is more relevant are the Datasets, not the Directories. Directories can be added as well which is also useful via USEDDS value, but without the USED value the other one isn't really relevant.
So this is what should be displayed.
ZFS Pools and their sizes from zfs list -o space (the accurate size)
ZFS Datasets
Directories if via USEDDS value
Datasets shouldn't have a preceeding forward slash because they're not directories, those are mount points or directories.
The backup-pool value should be
FS [zfs(backup-pool)]: Space utilization chart (relative to total)
instead this is displayed
FS [zfs(/backup-pool)]: Space utilization chart (relative to total)
This second value can also be there for files inside of this dataset excluding the child datasets, aka the files in this directory or mount point.
I'll attach Screenshots of Zabbix and ZFS space so that it can be compared.
These datasets contain Virtual Machines and the Datasets named by ending in disk0 are the disks and those are not mounted anywhere. USEDDS shows correct value because the zvol is a file or an img is also a file, but I guess the template omits them because they're not mounted as directories.
Other useful values are Disk space used by Snapshots and Child Datasets. Snapshots are more relevant.
But even if all of these are used that's also fine
AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD