• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

zfs zabbix monitoring

fred974

Daemon

Thanks: 34
Messages: 1,421

#26
zabbix_agentd -t vfs.zpool.discovery
Code:
vfs.zpool.discovery                           [t|{"data":[
{"{#ZPOOL}":"zroot"}
]}]
I added the template to host
Code:
    production.mydomain.co.uk    Applications 11    Items 1264    Triggers 344    Graphs 221    Discovery 4    Web    195.12.xx.xxx: 10050    Template FS ZFS, Template OS FreeBSD (Template App Zabbix Agent)
I can now see graphs for datasets. Can I see zfs frag ratio?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,875
Best answers: 6
Messages: 26,473

#27
Not sure if I had added that to this version. But it's fairly easy to add to the template. Just add vfs.zpool.get[#ZPOOL,fragmentation] to the item prototypes of the Zpool discovery.
 

fred974

Daemon

Thanks: 34
Messages: 1,421

#28
Is thsi what you mean?
/usr/local/etc/zabbix/zabbix_agentd.conf.d/userparam_zfs.conf
Code:
UserParameter=vfs.zpool.discovery,/usr/local/etc/zabbix/scripts/zpool-discovery.sh
UserParameter=vfs.zfs.discovery,/usr/local/etc/zabbix/scripts/zfs-discovery.sh
UserParameter=vfs.zfs.get[*],/sbin/zfs get -Hp -o value $2 $1 | sed -e 's/[x%]//'
UserParameter=vfs.zpool.get[*],/sbin/zpool get -Hp -o value $2 $1 | sed -e 's/[x%]//'
UserParameter=vfs.zpool.get[#ZPOOL,fragmentation]
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,875
Best answers: 6
Messages: 26,473

#29
No, not there. You add it to the template (the XML file you imported). The key vfs.zpool.get[#ZPOOL,fragmentation] is translated by Zabbix. The #ZPOOL is a macro that's used in the LLD (Low Level Discovery). There's some Zabbix magic happening and eventually it's /sbin/zpool get -Hp -o value fragmentation <#ZPOOL> that gets executed. There's no need to change any of the UserParameters, those are already set up correctly.

https://www.zabbix.com/documentation/3.4/manual/discovery/low_level_discovery
https://www.zabbix.com/documentation/3.4/manual/config/templates/template
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,875
Best answers: 6
Messages: 26,473

#30
I've updated the template, it now definitely does graph fragmentation. I've also added a few things like compression ratio and a whole bunch of ARC related sysctls. The I/O statistics work thanks to the patch provided by Eric A. Borisch.

Please use the updated template and scripts from here: https://github.com/SirDice/zabbix

I have a few other Zabbix scripts I've created over the years for things like MySQL, Apache and HAProxy. I'm going to add some of them there too. But I need to clean those up a bit before I would dare to publish them :D
 
Top