Ad Widget

Collapse

Zabbix Problems API: filter similar events with different priority - help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sire
    Senior Member
    • Jul 2010
    • 210

    #1

    Zabbix Problems API: filter similar events with different priority - help needed

    Consider a case when there are two similar events with different priorities on the same host:

    1)
    Code:
    "description": "More than {$ZPOOL_AVERAGE_ALERT}% used on zpool rpool on {HOST.NAME}"
    "expression": "( {180897} / ( {180898} + {180897} ) ) > ({$ZPOOL_AVERAGE_ALERT}/100)"
    "priority": "3"
    2)
    Code:
    "description": "More than {$ZPOOL_HIGH_ALERT}% used on zpool rpool on {HOST.NAME}"
    "expression": "( {180901} / ( {180902} + {180901} ) ) > ({$ZPOOL_HIGH_ALERT}/100)"
    "priority": "4"
    Zabbix problems dashboard and problems widget in a clever way are displaying only the second event. I would like to do achieve the same effect using Zabbix API, perhaps with some additional coding. Can someone please give me a hint on how the similar events with lower priorities can be filtered out?

    Click image for larger version

Name:	problem.png
Views:	210
Size:	12.4 KB
ID:	432160
    Last edited by sire; 24-09-2021, 15:38.
    Regards,
    Sergey Syreskin

    Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

    Temporary out of Zabbix business
  • sire
    Senior Member
    • Jul 2010
    • 210

    #2
    Seems there is no magic in the Zabbix GUI problems dashboard and widget. It might be that they are using the skipDependent parameter of the trigger.get API method. While I was using problem.get and event.get methods, where skipDependent is unavailable. Going to have a closer look at trigger.get and check the above idea.
    Regards,
    Sergey Syreskin

    Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

    Temporary out of Zabbix business

    Comment

    • sire
      Senior Member
      • Jul 2010
      • 210

      #3
      Yep, skipDependent did the trick. Problem solved.
      Regards,
      Sergey Syreskin

      Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

      Temporary out of Zabbix business

      Comment

      Working...