Hello!
According to the documentation https://www.zabbix.com/documentation...evel_discovery:
"Note that since Zabbix 4.2, the format of the JSON returned by low-level discovery rules has been changed. It is no longer expected that the JSON will contain the "data" object. Low-level discovery will now accept a normal JSON containing an array, in order to support new features such as the item value preprocessing and custom paths to low-level discovery macro values in a JSON document."
I have zabbix 4.4.5. I get the following JSON in the discovery rule using the http agent:
In LLD macros, I specify:
Checking the path to the node in JSONPath I get the result: ["1", "2"].
But the discovery rule does not work due to an error: "Cannot find the "data" array in the received JSON object.".
Why doesn't LLD work with json without a "data" object?
If I add the "data" object to json, then LLD starts working:
Checking the path to the node $..id in JSONPath I get the same result: ["1", "2"], but only one element of the following form is created from the prototype:
Why do values have this form and why was 1 value created, not 2?
According to the documentation https://www.zabbix.com/documentation...evel_discovery:
"Note that since Zabbix 4.2, the format of the JSON returned by low-level discovery rules has been changed. It is no longer expected that the JSON will contain the "data" object. Low-level discovery will now accept a normal JSON containing an array, in order to support new features such as the item value preprocessing and custom paths to low-level discovery macro values in a JSON document."
I have zabbix 4.4.5. I get the following JSON in the discovery rule using the http agent:
Code:
{
"@attributes": {
"version": "1.0"
},
"hdd": [
{
"@attributes": {
"version": "1.0"
},
"id": "1",
"hddName": "hdda",
"hddPath": {},
"hddType": "SATA",
"status": "ok",
"capacity": "5723166",
"freeSpace": "0",
"property": "RW"
},
{
"@attributes": {
"version": "1.0"
},
"id": "2",
"hddName": "hddb",
"hddPath": {},
"hddType": "SATA",
"status": "ok",
"capacity": "5723166",
"freeSpace": "0",
"property": "RW"
}
]
}
| {#TEST} | $..id |
But the discovery rule does not work due to an error: "Cannot find the "data" array in the received JSON object.".
Why doesn't LLD work with json without a "data" object?
If I add the "data" object to json, then LLD starts working:
Code:
{
"data": [
{
"@attributes": {
"version": "1.0"
},
"hdd": [
{
"@attributes": {
"version": "1.0"
},
"id": "1",
"hddName": "hdda",
"hddPath": {},
"hddType": "SATA",
"status": "ok",
"capacity": "5723166",
"freeSpace": "0",
"property": "RW"
},
{
"@attributes": {
"version": "1.0"
},
"id": "2",
"hddName": "hddb",
"hddPath": {},
"hddType": "SATA",
"status": "ok",
"capacity": "5723166",
"freeSpace": "0",
"property": "RW"
}
]
}
]
}
Why do values have this form and why was 1 value created, not 2?
Comment