dr_
dr_

Reputation: 2302

Aggregate item data from Zabbix?

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.

Upvotes: 0

Views: 7595

Answers (2)

dr_
dr_

Reputation: 2302

Thanks. Following your advice, I managed to do what I wanted. Here are the steps:

  1. create a host group my_DB_cluster and populate it with the nodes' IP addresses;
  2. create a new template my_template and add it to the host group my_DB_cluster;
  3. inside my_template, create a new item with key grpsum[my_DB_cluster,icmpping,last,0];
  4. create a new value mapping and associate it to the item's results, in order to get a message ("cluster is down") instead of a simple value (0);
  5. inside my_template, create triggers with different severity on key grpsum[my_DB_cluster,icmpping,last,0].

Upvotes: 0

asaveljevs
asaveljevs

Reputation: 2250

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.

Upvotes: 1

Related Questions