触发器是“评估”由监控项采集的数据并表示当前系统状况的逻辑表达式。
当监控项用于采集系统的数据时,始终遵循这些数据是非常不切合实际的,因为这些数据始终在等待一个令人担忧或者值得关注的状态。然而这个“评估”数据的工作可以留给触发器表达式。
触发器表达式允许定义一个什么状况的数据是“可接受”的阈值。因此,如果接收的数据超过了可接受的状态,则触发器会被触发 - 或将状态更改为异常。
一个触发器可以拥有下面几种状态:
值 | 述 |
---|---|
OK | 这是一个正常的触发器状态。在旧版本的Zabbix中称为FALSE。 |
PROBLEM | 通常意味着发生了某些事情。例如,处理器的负载较高。在旧版本的Zabbix中称为TRUE。 |
每当Zabbix server接收到作为表达式一部分的新值时,都会重新计算触发器状态(表达式)。
如果在表达式中使用基于时间的函数(nodata(), date(), dayofmonth(), dayofweek(), time(), now()),触发器就会由Zabbix history syncer进程每30秒重新计算一次。如果在表达式中同时使用基于时间和非基于时间的函数,当接收到一个新值和每隔30秒都会重新计算触发器的状态。
你可以构建触不同复杂程度的触发器表达式
A trigger is recalculated every time Zabbix server receives a new value that is part of the expression. When a new value is received, each function that is included in the expression is recalculated (not just the one that received the new value).
Additionally, a trigger is recalculated each time when a new value is received and every 30 seconds if time-based functions are used in the expression.
Time-based functions are nodata(), date(), dayofmonth(), dayofweek(), time(), now()); they are recalculated every 30 seconds by the Zabbix history syncer process.
An evaluation period is used in functions referencing the item history. It allows to specify the interval we are interested in. It can be specified as time period (30s, 10m, 1h) or as a value range (#5 - for five latest values).
The evaluation period is measured up to "now" - where "now" is the latest recalculation time of the trigger (see Calculation time above); "now" is not the "now" time of the server.
The evaluation period specifies either:
Note that: