Cosium / zabbix_zfs-on-linux

zabbix template and user parameters to monitor zfs on linux
MIT License
76 stars 50 forks source link

Zabbix Agent2 - Discovery Error #25

Closed korshakov closed 3 years ago

korshakov commented 3 years ago

Hello, when i go to host configuration in web gui of zabbix server to execute discovery there is this error for ZFS templates:

Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper'

and then it says Status: unsupported Ubuntu Server: 20.04 with zfs on linux 0.8.3-1ubuntu12.5 I used the newer template without the need of sudo.

AceSlash commented 3 years ago

Strange, could you please try this directly on the monitored server:

sudo -u zabbix zabbix_agentd -t zfs.pool.discovery
sudo -u zabbix zabbix_agentd -t zfs.fileset.discovery
sudo -u zabbix zabbix_agentd -t zfs.vdev.discovery

If any of them return an error, can you paste it here?

Also, double check taht you don't have any sudo in the userparameter file ZoL.conf.

EDIT: I just realized that your are using the zabbix agent2, which is currently not supported (it's on my todo list, but since I don't use it, it's rather low at the moment). So your issue may be related to that, can you try with zabbix_agentd version 1? I ought to modify the documentation to state that zabbix agent2 is not yet supported.

korshakov commented 3 years ago

Thanks for your help. I understand zabbixagent2 is not out yet. The only reason I use zabbix agent2 is for docker monitoring. Here are outputs of commands you requested for future reference:

ladia@lss-001:/etc/zabbix/zabbix_agent2.d$ sudo -u zabbix zabbix_agent2 -t zfs.pool.discovery zfs.pool.discovery [s|{ "data":[{"{#POOLNAME}":"array"}]}]

ladia@lss-001:/etc/zabbix/zabbix_agent2.d$ sudo -u zabbix zabbix_agent2 -t zfs.fileset.discovery zfs.fileset.discovery [s|{ "data":[{"{#FILESETNAME}":"array"}]}]

ladia@lss-001:/etc/zabbix/zabbix_agent2.d$ sudo -u zabbix zabbix_agent2 -t zfs.vdev.discovery zfs.vdev.discovery [s|{ "data":[{"{#VDEV}":"sdb"}, {"{#VDEV}":"sde"}, {"{#VDEV}":"sdf"}]}]

korshakov commented 3 years ago

I managed to fix it the issue was my own stupidity. I've copy pasted the wrong user parameters into .conf file.

I can confirm working template and .conf file with zabbix agent 2 on ubuntu server 20.04 with zfs on linux 0.8.3-1ubuntu12.5