I'm trying to calculate the total time a host has been unreachable but not in maintenance during a specific time period by using the event.get API.
At first glance I seemed to be able to exclude all events with "suppressed" = "1", but I then noticed that if I removed a host from maintenance mode, and re-ran my script, the events that occurred in the past while the host was in maintenance, now return "suppressed" = "0":
Before:
[
{
"eventid": "51210943",
"source": "0",
"object": "0",
"objectid": "104378",
"clock": "1582279294",
"value": "1",
"acknowledged": "0",
"ns": "646003962",
"name": "erdi-faz is UNREACHABLE or DOWN",
"severity": "5",
"r_eventid": "51212078",
"c_eventid": "0",
"correlationid": "0",
"userid": "0",
"suppressed": "1"
}
]
After I've removed the host from maintenance:
[
{
"eventid": "51210943",
"source": "0",
"object": "0",
"objectid": "104378",
"clock": "1582279294",
"value": "1",
"acknowledged": "0",
"ns": "646003962",
"name": "erdi-faz is UNREACHABLE or DOWN",
"severity": "5",
"r_eventid": "51212078",
"c_eventid": "0",
"correlationid": "0",
"userid": "0",
"suppressed": "0"
}
]
Shouldn't the suppressed attribute of an event reflect if the host was in maintenance at the time the event occurred, rather than the current status?
Running Zabbix 4.2.8.
PS: After setting the host back into maintenance, the old event still show as suppressed=0, so it only seemed to reset suppressed=0 when the host was removed from maintenance.
At first glance I seemed to be able to exclude all events with "suppressed" = "1", but I then noticed that if I removed a host from maintenance mode, and re-ran my script, the events that occurred in the past while the host was in maintenance, now return "suppressed" = "0":
Before:
[
{
"eventid": "51210943",
"source": "0",
"object": "0",
"objectid": "104378",
"clock": "1582279294",
"value": "1",
"acknowledged": "0",
"ns": "646003962",
"name": "erdi-faz is UNREACHABLE or DOWN",
"severity": "5",
"r_eventid": "51212078",
"c_eventid": "0",
"correlationid": "0",
"userid": "0",
"suppressed": "1"
}
]
After I've removed the host from maintenance:
[
{
"eventid": "51210943",
"source": "0",
"object": "0",
"objectid": "104378",
"clock": "1582279294",
"value": "1",
"acknowledged": "0",
"ns": "646003962",
"name": "erdi-faz is UNREACHABLE or DOWN",
"severity": "5",
"r_eventid": "51212078",
"c_eventid": "0",
"correlationid": "0",
"userid": "0",
"suppressed": "0"
}
]
Shouldn't the suppressed attribute of an event reflect if the host was in maintenance at the time the event occurred, rather than the current status?
Running Zabbix 4.2.8.
PS: After setting the host back into maintenance, the old event still show as suppressed=0, so it only seemed to reset suppressed=0 when the host was removed from maintenance.
Comment