Ad Widget

Collapse

Suppressed status of events pulled via API is incorrect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msundman
    Junior Member
    • Feb 2020
    • 2

    #1

    Suppressed status of events pulled via API is incorrect

    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.
  • msundman
    Junior Member
    • Feb 2020
    • 2

    #2
    I've now browsed the actual database tables events and event_suppress and concluded that Zabbix by design does not store the suppressed status for each historical event. So I guess it works as designed.

    I don't understand why it's designed like this though. Wouldn't it make more sense to store it on each event, so you can browse historically if the host was in maintenance when the event occurred like I'm trying to do?

    Has this changed in 4.4 or 5.0?

    Comment

    • sambhu.prakash
      Junior Member
      • Apr 2021
      • 20

      #3
      Hi Zabbix admins,

      Was there any change to this behavior in the latest releases ? I am on 5.4.10, I still see the same.
      If not, is there another way we could find the suppression status of a historic event ?

      Thanks.

      Comment

      Working...