-
Incident report
-
Resolution: Done
-
Major
-
None
-
3.4.11
-
None
-
Docker image zabbix/zabbix-server-mysql ubuntu-3.4-latest
We have one userparam for discover cifs mountpoint that returns a json but on discovery rules says "value should be a json object"
Steps to reproduce:
- Create /etc/zabbix/zabbix_agentd.conf.d/samba.userparams.conf
UserParameter=discoverSMB,echo -n '{"data":['; for i in $(grep -v "^#" /etc/fstab |grep -i -e cifs -e smbfs | awk '{print $2}'); do echo -n '{"{#MOUNTPOINT}":"'$i'"},';done | sed -e 's/,$//' ; echo -n ']}'
- Go to webinterface and create a discovery rule on empty template:
Name: CIFSmountpoints
Type: Zabbix agent
Key: discoverSMB
- Go to server and check what you get:
root@zabbix-server:/var/lib/zabbix# zabbix_get -s x.x.x.x -k discoverSMB {"data":[{"{#MOUNTPOINT}":"/mnt/winfs/directorioBackup"},{"{#MOUNTPOINT}":"/mnt/winfs/directorioBBDD"}]}
- Validate json on https://jsonlint.com/
- Apply the template to a host and check that you get the alert "Value should be a JSON object"