Problem with discovery rule 'Disks discovery'
DANic-git opened this issue · comments
Zabbix 3.0.2 (server and agent)
OS: CentOS 7
There is error 'Value should be a JSON object.' on page discovery rules
http://i.imgur.com/H542zcN.png
Replace string with 'UserParameter=iostat.discovery' in iostat.conf on next
UserParameter=iostat.discovery, iostat -d | awk 'BEGIN {check=0;count=0;array[0]=0;} {if(check==1 && $1 != ""){array[count]=$1;count=count+1;}if($1=="Device:"){check=1;}} END {printf("{\n\t"data":[\n");for(i=0;i<count;++i){printf("\t\t{\n\t\t\t"{#HARDDISK}":"%s"}", array[i]); if(i+1<count){printf(",\n");}} printf("]\n}\n");}'
fixed this problem
current discovery produces valid JSON. Your command fails with awk syntax errors, probably due to lack of escaping. Closing this issue.