Ad Widget

Collapse

3 or more Zabbix Agents Unavailable in a Host Group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BigDave
    Junior Member
    • Feb 2026
    • 2

    #1

    3 or more Zabbix Agents Unavailable in a Host Group

    Zabbix version 7.0.23

    I'm tryng to set-up a trigger if 3 or more Zabbix agents go unavailable in a Host Group. I understand that one option is to have a calculated item and then trigger off of that. I'm struggling with the formula for both

    Has anyone set-up something simliar so I can see how it's suppose to work?
    Last edited by BigDave; 26-02-2026, 17:20.
  • guntis_liepins
    Member
    • Oct 2025
    • 41

    #2
    This is a bit tricky question and solution I offer may be not optimal, but since nobody suggest anything better here will my 5 cents.

    1. we need some item common in host group which every host in this group has . I will use agent.ping in this example
    Make calculated item
    name hosts_in_group
    type Calculated
    key hosts_in_group
    Type of information integer
    formula sum(exists_foreach(/*/agent.ping?[group="test_servers"]))
    This work this way - exists_foreach Returns '1' for each enabled item , item selector - selects whole host group , then sum this value.
    As each host must return 1 if agent.ping is enabled, for each host then sum of all items will be equalt to a count of hosts in host group.

    2. we need item which returns 1 or 0 in each monitoring cycle, which would indicate if host are up or down.
    agent.ping does not fit out purpose as it returns 1 - available, but does not return data if not available.
    so we for every host create item is_online
    name Is host online
    type Calculated
    key is_online
    type of information Integer
    formula 1-nodata(//agent.ping,60s)
    Nodata will return 1 if host have not received successful agent.ping for one minute. So his item will return 0 if host is offline , but will return 1 if host is online.

    3. Now we create function which will show us ho many hosts are online
    name hosts_online
    type Calculated
    key hosts_online
    type of information integer
    formula sum(last_foreach(/*/is_online?[group="test_servers"]))
    This function will get last value for each is_online item in group test_servers then sum it together.
    As online hosts count as 1 , offline hosts as 0 this item will return integer host many hosts are online

    Now we can create trigger which will trigger when more than three hosts are offline (I created virtual host tt which hold two items hosts_in_group and hosts_online and created problem there )

    Attached Files

    Comment

    • BigDave
      Junior Member
      • Feb 2026
      • 2

      #3
      Thank you for the response.

      Would I be able to use zabbix[host,agent,available] instead of agent.ping?

      From what I've found agent.ping returns no data in case of unavailability, whereas zabbix[host,agent,available] returns a 0

      So I wouldn't need step 2 and can replace 'is_online?' in step 3 with 'zabbix[host,agent,available]?'

      Correct?

      Edit: Also to make this more difficult I have 3 host groups so this needs to work if 3 or more hosts are down in each group

      2nd Edit: SOLVED: Created a host per group with the items - 'hosts_in_group' &' hosts_online' and the trigger. Each other host has the 'Is host online' item created via their template.
      Last edited by BigDave; Yesterday, 18:46.

      Comment

      Working...