Ad Widget

Collapse

Trigger to fire when two of three Hosts are failing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Felix Schäfer
    Junior Member
    • Mar 2021
    • 4

    #1

    Trigger to fire when two of three Hosts are failing

    Is there an easy way way to create a trigger that fires when a certain number of hosts fail?

    We use Zabbix to perform web checks from multiple hosts over zabbix proxies. That way we can probe a web API from three different sites.
    We want Zabbix to raise an alert, when the web checks on 2 of the 3 hosts fail.
    Currently we run three web check hosts: wch1, wch2 and wch3.
    We create the trigger by connecting the single host triggers with logical and and or.

    ({wch1:web.test.fail[api check].count(#3,0,gt)}>1 and {wch2:web.test.fail[api check].count(#3,0,gt)}>1) or
    ({wch1:web.test.fail[api check].count(#3,0,gt)}>1 and {wch3:web.test.fail[api check].count(#3,0,gt)}>1) or
    ({wch3:web.test.fail[api check].count(#3,0,gt)}>1 and {wch3:web.test.fail[api check].count(#3,0,gt)}>1)

    That way we test if two of the three checks fail it works.
    But this logical construction is getting more complicated the more hosts you want to check.

    It would be great if there would be some way to configure a trigger that fires, if there is a defined subset failing.
    For example define a list of five trigers and fire an alarm if three of the five fail.

    I did not find any elegant solution yet.

    Thanks for your help

    Felix Schäfer

    ------------------------------------------------------
    Zabbix Version: 5.0.8
  • kriZtof
    Junior Member
    • Sep 2022
    • 1

    #2
    It's been a while... found anything better than the 'and/or' combinations?
    I'm also interested in such config or feature. Thanks!

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      *Web monitoring
      Since you are using Zabbix 5, have you tried Aggregate checks item type?

      I guess the logic would be:
      Create an item that counts your hosts "web.test.fail[api check]" items.
      Code:
      grpsum["Your Web Scenario Group","web.test.fail[api check]",count,<your TIMEPERIOD>]
      Create a trigger that says: If the count is greater than or equal to (your own value), then trigger an event.
      Code:
      {your_aggregate_host:grpsum["Your Web Scenario Group","web.test.fail[api check]",count,<TIMEPERIOD>].last()}>=2
      I could not test this scenario, but I think it might work out.
      Would be great to hear your feedback.

      Comment

      Working...