I am trying to write a discovery rule for an HTTP agent to query a REST API. The REST API to query is the one from deconz,
and the result of the query looks like this
there are more fields, but what I need for the LLD macros is the index (1, 2,...) and the name. All examples I could find assume that all data is inside the records, usually in an array, but here the index is the key for the respective record. What magic JSONPath expressions would deliver the keys and names?
Is it possible to test such HTTP agent discovery rules somehow?
Perhaps I am better off writing an external script that shuffles the data around in a form that is easier to read.
This is for Zabbix 4.4.10/CentOS 7
Roman
and the result of the query looks like this
Code:
{
"1": {
"name": "Light 1",
"uniqueid": "00:21:2E:FF:FF:00:73:9F-0A"
...
},
"2": {
"name": "Light 2",
"type": "Dimmable light",
"uniqueid": "00:21:2E:FF:FF:00:73:9F-0B"
...
}
...
}
Is it possible to test such HTTP agent discovery rules somehow?
Perhaps I am better off writing an external script that shuffles the data around in a form that is easier to read.
This is for Zabbix 4.4.10/CentOS 7
Roman
Comment