I used to use this template to monitor ZFS using Zabbix:
Under Zabbix 4.0 and that worked fine but that template doesn't work for me with Zabbix 6 for monitoring ZFS pools
I've tried the Zabbix 6.0 ZFS templates that are in the zabbix community github repo but I've not been able to get either template_zfs_on_linux.yaml nor template_zfs_on_linux_active.yaml to work properly with Zabbix 6.0 and Ubuntu 22.04. Both my Zabbix server and the host with the ZFS disk are running Ubuntu 22.04. The main thing I need to work with these ZFS templates is the monitoring of the ZFS pool's health but Zabbix isn't displaying the DEGRADED status for my zabbix client2 running ZFS host when I (intentionally) put the pool into a degraded state.
The first thing I noticed that stopped these templates from working at all for me with Ubuntu is that the paths for both the zfs and zpool commands are wrong for Ubuntu users. To get these templates to work at all, Ubuntu users have to replace every instance of /sbin/zfs with /usr/sbin/zfs and /sbin/zpool with /usr/sbin/zpool. Doing that fixes most of the ZFS monitoring but it doesn't fix the monitoring of the pools health.
userparams_zol_without_sudo.conf has these lines for monitoring pool health:
I read here:
That positional macros aren't used any more in Zabbix 6.0 so maybe this is part of my problem?
I tried a few things such as:
With and without the quotes or not including a (positional) macro at the end at all but nothing has fixed the ZFS health monitoring for me yet. I have intentionally degraded the pool but Zabbix isn't alerting me of that. Zabbix works fine otherwise.
I've also tried using template_zfs_on_linux_active.yaml but I had to modify that slightly to get it to import properly. I had to change the version string from "6.2" to "6.0" (its in a dir called 6.0 so surely I should really be 6.0 or in a 6.2 dir?) and I had to change L4 from template_groups: to just groups: before Zabbix would import it.
Any tips on debugging this are appreciated, thanks!
Under Zabbix 4.0 and that worked fine but that template doesn't work for me with Zabbix 6 for monitoring ZFS pools
I've tried the Zabbix 6.0 ZFS templates that are in the zabbix community github repo but I've not been able to get either template_zfs_on_linux.yaml nor template_zfs_on_linux_active.yaml to work properly with Zabbix 6.0 and Ubuntu 22.04. Both my Zabbix server and the host with the ZFS disk are running Ubuntu 22.04. The main thing I need to work with these ZFS templates is the monitoring of the ZFS pool's health but Zabbix isn't displaying the DEGRADED status for my zabbix client2 running ZFS host when I (intentionally) put the pool into a degraded state.
The first thing I noticed that stopped these templates from working at all for me with Ubuntu is that the paths for both the zfs and zpool commands are wrong for Ubuntu users. To get these templates to work at all, Ubuntu users have to replace every instance of /sbin/zfs with /usr/sbin/zfs and /sbin/zpool with /usr/sbin/zpool. Doing that fixes most of the ZFS monitoring but it doesn't fix the monitoring of the pools health.
userparams_zol_without_sudo.conf has these lines for monitoring pool health:
Code:
# pool health UserParameter=zfs.zpool.health[*],/sbin/zpool list -H -o health $1
That positional macros aren't used any more in Zabbix 6.0 so maybe this is part of my problem?
I tried a few things such as:
Code:
# pool health
UserParameter=zfs.zpool.health[*],/sbin/zpool list -H -o health "{#POOLNAME}"
I've also tried using template_zfs_on_linux_active.yaml but I had to modify that slightly to get it to import properly. I had to change the version string from "6.2" to "6.0" (its in a dir called 6.0 so surely I should really be 6.0 or in a 6.2 dir?) and I had to change L4 from template_groups: to just groups: before Zabbix would import it.
Any tips on debugging this are appreciated, thanks!

Comment