Hi everyone,
I'm using a custom script that provides data in LLD format and using that information in Zabbix 3.2.11 which is running on Ubuntu. The data script outputs is in following format:
I have created a discovery rule that uses the external script and created an item prototype for it. The item prototype is as follows:
Then the discovery rule reports an error:
. I think I'm using the calculated item prototype in a wrong way, but I guess you can get a hint what I'm trying to implement.
Zabbix can parse the JSON data fine, as I'm able to get the correct items if I set the formula e.g to: now
The script I'm using, just in case you're interested is a modified version of this script: https://gist.github.com/dav3860/bdc658da6e7579d385d3
Thanks for reading! Any help appreciated!
I'm using a custom script that provides data in LLD format and using that information in Zabbix 3.2.11 which is running on Ubuntu. The data script outputs is in following format:
Code:
{
"data": [
{
"{#JSONDESCRIPTION}": "DB check",
"{#JSONCOMPLETEKEY}": "com.foobar.dbcheck",
"{#JSONISHEALTHY}": true,
"{#JSONNAME}": "Database"
},
{
"{#JSONDESCRIPTION}": "Lucene check",
"{#JSONCOMPLETEKEY}": "com.foobar.indexcheck",
"{#JSONISHEALTHY}": true,
"{#JSONNAME}": "Lucene index"
}
]
}
Code:
Name: {#JSONDESCRIPTION}
Type: Calculated
Key: health[{#JSONCOMPLETEKEY}]
Formula: {#JSONISHEALTHY}.str("true")
Cannot update an item: no value for macro "{#JSONISHEALTHY}"
Zabbix can parse the JSON data fine, as I'm able to get the correct items if I set the formula e.g to: now
The script I'm using, just in case you're interested is a modified version of this script: https://gist.github.com/dav3860/bdc658da6e7579d385d3
Thanks for reading! Any help appreciated!
Comment