Hi,
I have a question that I hope that that the Zabbix Community can help me with.
I've just recently started trying out using the Zabbix API to get some relevant information that I need to store. My goal is to get problems, events, triggers and what host they are associated with.
I start of by using the problem.get function which gives me an eventid but also an objectid which I use to run a trigger.get with triggerids set to the objectid I got from my problem or event.
The trigger.get gives me then a expression that looks something like this: "expression": "{46076}<>0",
As I understand it, the 46076 in this case is a itemid that I use to run a item.get which then gives me a hostid.
However, the hostid doesn't return the correct host I'm expecting.
If I start with a known problem I know is connected to host X, I can run through all these steps but end up with host Y at the end of it.
Is there anything I'm doing wrong that you can see right away?
Very thankful for any response that can lead me in the right direction!
Regards,
Rickard
I have a question that I hope that that the Zabbix Community can help me with.
I've just recently started trying out using the Zabbix API to get some relevant information that I need to store. My goal is to get problems, events, triggers and what host they are associated with.
I start of by using the problem.get function which gives me an eventid but also an objectid which I use to run a trigger.get with triggerids set to the objectid I got from my problem or event.
Code:
{
"jsonrpc": "2.0",
"method": "trigger.get",
"params": {
"output": "extend",
"triggerids": "[[objectid}}"
},
"auth": "{{API-Token}}",
"id": 2
}
As I understand it, the 46076 in this case is a itemid that I use to run a item.get which then gives me a hostid.
However, the hostid doesn't return the correct host I'm expecting.
If I start with a known problem I know is connected to host X, I can run through all these steps but end up with host Y at the end of it.
Is there anything I'm doing wrong that you can see right away?
Very thankful for any response that can lead me in the right direction!
Regards,
Rickard