Hello,
i'm search to collect data from a json url.
i'm able to execute from zabbix server terminal
and have this output
so i want collect status of WAN1 (8.8.8.8)
"status": "up",
i create item and in preprocessing add a
jsonpath with parameters
$.id[?(@.host=='8.8.8.8')].status
but when i test i have this error
https://www.zabbix.com/documentation...items/jsonpath
but i think my expression is ok, but i have error
so i presume is initial dot...
can someone help me?
thank you in advance
i'm search to collect data from a json url.
i'm able to execute from zabbix server terminal
Code:
curl -k https://10.200.100.12:10443/rest/tool/netwatch/print -u admin:12345678 -X POST | jq .
Code:
[
{
".id": "*1",
"comment": "CHECK WAN1",
"disabled": "false",
"done-tests": "18692",
"down-script": "",
"failed-tests": "0",
"host": "8.8.8.8",
"http-codes": "",
"interval": "15s",
"since": "2024-02-10 04:35:11",
"status": "up",
"test-script": "",
"timeout": "5s",
"type": "simple",
"up-script": ""
},
{
".id": "*2",
"comment": "CHECK WAN2",
"disabled": "false",
"done-tests": "18692",
"down-script": "",
"failed-tests": "0",
"host": "1.1.1.1",
"http-codes": "",
"interval": "15s",
"since": "2024-02-10 04:35:11",
"status": "up",
"test-script": "",
"timeout": "5s",
"type": "simple",
"up-script": ""
}
]
"status": "up",
i create item and in preprocessing add a
jsonpath with parameters
$.id[?(@.host=='8.8.8.8')].status
but when i test i have this error
- cannot extract value from json by path "$.id[?(@.host=='8.8.8.8')].status": no data matches the specified path
https://www.zabbix.com/documentation...items/jsonpath
but i think my expression is ok, but i have error
so i presume is initial dot...
can someone help me?
thank you in advance
Comment