I would like to have Zabbix monitor different items (on the same host, or on different hosts) and assign a value depending on the outcome, then have it fire (or not) a trigger depending on the aggregation of these values.
For instance, let's imagine a cluster of 3 database nodes. Zabbix monitors every one of them via ping and increases a global variable by 1 if the node is reachable. After a round, the variable could have the following values:
Then Zabbix fires a trigger with WARNING severity if value is 1, and a trigger with HIGH severity if value is 0.
Is there a way to do this natively or via a module, without having to use the APIs? Thanks.
In order to aggregate data from several items into one, you can either use aggregate items or calculated items. Aggregate items allow to aggregate all items with the same key in the specified host groups, whereas calculated items allow arbitrary operations on items based on a formula.
In order to have two triggers with different severities, you may find trigger dependencies useful. Here, a trigger with a lower dependency would depend on a trigger with a higher dependency.