Hello.
I'm trying to get a precise ITEM by using the associated trigger id.
I noticed that "search" function never works and the response is giving all the items of the selected host instead of the single item.
Env: Zabbix 7.4.2
Usr: Admin (token)
I followed the manual: https://www.zabbix.com/documentation...rence/item/get
TEST n1: USING TRIGGERIDS
TEST n2: USING ITEMIDS (just as debug pourpose)
TEST n3: USING non-existent Trigger ID (just as debug pourpose)
TEST n4: DROPPING THE WHOLE search FUNCTION
RESULT:
Each test is giving the same output (just a full dump of all items of the Host 10765).
Does someone knows what's wrong in my tests?
Should I consider this is a bug
Thanks to anyone
I'm trying to get a precise ITEM by using the associated trigger id.
I noticed that "search" function never works and the response is giving all the items of the selected host instead of the single item.
Env: Zabbix 7.4.2
Usr: Admin (token)
I followed the manual: https://www.zabbix.com/documentation...rence/item/get
TEST n1: USING TRIGGERIDS
Code:
get_response=$(curl -sk -X POST $URL -H "Content-Type: application/json" -H "Authorization: Bearer $AUTH" -d '
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10765",
"with_triggers": true,
"search": {
"triggerids": "123456"
},
"sortfield": "name"
},
"id": 1
}')
TEST n2: USING ITEMIDS (just as debug pourpose)
Code:
get_response=$(curl -sk -X POST $URL -H "Content-Type: application/json" -H "Authorization: Bearer $AUTH" -d '
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10765",
"with_triggers": true,
"search": {
"itemids": "123456"
},
"sortfield": "name"
},
"id": 1
}')
Code:
get_response=$(curl -sk -X POST $URL -H "Content-Type: application/json" -H "Authorization: Bearer $AUTH" -d '
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10765",
"with_triggers": true,
"search": {
"triggerids": "1"
},
"sortfield": "name"
},
"id": 1
}')
TEST n4: DROPPING THE WHOLE search FUNCTION
Code:
get_response=$(curl -sk -X POST $URL -H "Content-Type: application/json" -H "Authorization: Bearer $AUTH" -d '
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "10765",
"with_triggers": true,
},
"sortfield": "name"
},
"id": 1
}')
RESULT:
Each test is giving the same output (just a full dump of all items of the Host 10765).
Does someone knows what's wrong in my tests?
Should I consider this is a bug
Thanks to anyone
Comment