Hello,
I'm using the Zabbix API to retrieve all the problems using both "problem.get" and "event.get" methods.
But in the output I don't see any information about the host that generated the problem.
How do I correlate the event object with the host? Or the problem event object with the host?
This is my methods invocation:
And this is the output of the problem event object:
And this of the event object:
Thanks
I'm using the Zabbix API to retrieve all the problems using both "problem.get" and "event.get" methods.
But in the output I don't see any information about the host that generated the problem.
How do I correlate the event object with the host? Or the problem event object with the host?
This is my methods invocation:
Code:
{
"jsonrpc": "2.0",
"method": "problem.get",
"params": {
"output": "extend",
"selectAcknowledges": "extend",
"selectTags": "extend",
"selectSuppressionData": "extend",
"recent": "true",
"sortfield": ["eventid"],
"sortorder": "DESC"
},
"auth": "zabbix_account_token",
"id": 1
}
Code:
{
"jsonrpc": "2.0",
"method": "event.get",
"params": {
"output": "extend",
"select_acknowledges": "extend",
"selectTags": "extend",
"selectSuppressionData": "extend",
"eventids": "41606673",
"sortfield": ["clock", "eventid"],
"sortorder": "DESC"
},
"auth": "zabbix_account_token",
"id": 1
}
Code:
{
"jsonrpc": "2.0",
"result": [
{
"eventid": "41606673",
"source": "0",
"object": "0",
"objectid": "26399",
"clock": "1741021620",
"ns": "407117816",
"r_eventid": "0",
"r_clock": "0",
"r_ns": "0",
"correlationid": "0",
"userid": "0",
"name": "Linux: High swap space usage (less than 20% free)",
"acknowledged": "0",
"severity": "2",
"opdata": "Free: 0.02501 %, total: 1.6 GB",
"acknowledges": [],
"suppression_data": [],
"suppressed": "0",
"urls": [],
"tags": [
{
"tag": "scope",
"value": "capacity"
},
{
"tag": "component",
"value": "memory"
},
{
"tag": "component",
"value": "storage"
},
{
"tag": "class",
"value": "os"
},
{
"tag": "target",
"value": "linux"
}
]
},
And this of the event object:
Code:
{
"jsonrpc": "2.0",
"result": [
{
"eventid": "41606673",
"source": "0",
"object": "0",
"objectid": "26399",
"clock": "1741021620",
"value": "1",
"acknowledged": "0",
"ns": "407117816",
"name": "Linux: High swap space usage (less than 20% free)",
"severity": "2",
"r_eventid": "0",
"c_eventid": "0",
"correlationid": "0",
"userid": "0",
"opdata": "Free: 0.06931 %, total: 1.6 GB",
"acknowledges": [],
"suppression_data": [],
"suppressed": "0",
"urls": [],
"tags": [
{
"tag": "scope",
"value": "capacity"
},
{
"tag": "component",
"value": "memory"
},
{
"tag": "component",
"value": "storage"
},
{
"tag": "class",
"value": "os"
},
{
"tag": "target",
"value": "linux"
}
]
}
],
"id": 1
}
Thanks
Comment