Zabbix Aggregate items to monitor VPN connectivity

118 Views Asked by At

I´m monitoring lot of servers, but once the VPN is down Zabbix causes multiple alarms for each hosts.

My solution was to create a calculated item, using foreach to get "0" if all the hosts in the hostgroup are down. In that case I would have one alert saying that connection to X group is down and not 200 alerts for each host like now.

I tried with these items, but not successfully:

count(last_foreach(/*/agent.ping?[group="HOSTGROUP-A"]))

nodata(last_foreach(/*/agent.ping?[group="HOSTGROUP-A"]))

I thought this would work, but if I stop the zabbix agent in all the hosts from this Hostgroup, it still returns X, instead of 0.

I think it just counts the agent.ping items assigned to each host, but not the real output from this item. Maybe because the agent.ping return 1 or "error" if no connection is done.

Also tried with "nodata", but seems to be not supported together with the _foreach

Tried with count/sum. Other operators give erros.

1

There are 1 best solutions below

0
Simone Zabberoni On

You should use trigger dependencies.

Sometimes the availability of one host depends on another. A server that is behind a router will become unreachable if the router goes down. With triggers configured for both, you might get notifications about two hosts down - while only the router was the guilty party While Zabbix does not support dependencies between hosts directly, they may be defined with another, more flexible method - trigger dependencies. A trigger may have one or more triggers it depends on. [..] So in our simple example we open the server trigger configuration form and set that it depends on the respective trigger of the router. With such dependency, the server trigger will not change its state as long as the trigger it depends on is in the 'PROBLEM' state - and thus no dependent actions will be taken and no notifications sent.

You can set dependancies by hand, or through a script that uses the trigger api