# 1 配置一个触发器

#### 概述

配置一个触发器，请执行以下操作：

-   点击Zabbix上方菜单栏的*Configuration* → *Hosts*
-   在Host那一行点击*Triggers*
-   在右上角点击*Create
    Trigger*（或者在触发器名称上编辑一个现有的触发器）
-   在打开的页面输入触发器的参数

#### 配置

**Trigger**标签页包含了所有必需的触发器属性。

![](../../../../assets/en/manual/config/triggers/trigger.png)

|参数                    描|<|
|-----------------------------|-|
|*Name*|触发器名称。<br>这个名称可能包含支持的[macros](/manual/appendix/macros/supported_by_location):`{HOST.HOST}, {HOST.NAME}, {HOST.CONN}, {HOST.DNS}, {HOST.IP}, {ITEM.VALUE},{ITEM.LASTVALUE}` 和 `{$MACRO}`。<br>**$1, $2...$9**宏可以用来指代第一、第二至第九个表达式的常量。<br>*备注*：$1-$9如果引用了相对简单的常量或易懂的表达式，宏将会正确解析。例如，如果表达式为{New host:system.cpu.load\[percpu,avg1\].last()}>5，则名为"Processor load above $1 on {HOST.NAME}"的触发器名称将自动更改为"Processor load above 5 on New host"|
|*Severity*|通过点击对应的按钮来设置所需的触发器[severity](severity)|
|*Problem expression*|用于定义问题条件的逻辑[expression](expression)。|
|*OK event generation*|OK event generation选项：\\\\**Expression** - OK events are generated based on the same expression as problem events;<br>**Recovery expression** - OK events are generated if the recovery expression evaluates to TRUE **and** the problem expression evaluates to FALSE;<br>**None** - in this case the trigger will never return to an OK state on its own.<br>Supported since Zabbix 3.2.0.|
|*Recovery expression*|Logical [expression](expression) used to define the conditions when the problem is resolved.<br>This field is optional and only available if 'Recovery expression' is selected for *OK event generation*.<br>Supported since Zabbix 3.2.0.|
|*Tag for matching*|Enter event tag name to use for event correlation.<br>This field is displayed if 'All problems if tag values match' is selected for the *OK event closes* property and is mandatory in this case.<br>Supported since Zabbix 3.2.0.|
|*Tags*|Set custom tags to mark trigger events.<br>[Event tags](/manual/config/triggers/event_tags) can be used for event correlation, in action conditions and will also be seen in *Monitoring* → *Problems*.<br>Tags are a pair of tag name and value. You can use only the name or pair it with a value.<br>User macros, user macro context, low-level discovery macros and macro [functions](/manual/config/macros/macro_functions): `{{ITEM.VALUE}.regsub(pattern, output)}, {{ITEM.VALUE}.iregsub(pattern, output)}` are supported in event tags. Low-level discovery macros can be used inside macro context. If the total length of expanded value exceeds 255, it will be cut to 255 characters.<br>Supported since Zabbix 3.2.0.|
|*Allow manual close*|Check to allow [manual closing](/manual/config/events/manual_close) of problem events generated by this trigger. Manual closing is possible when acknowledging problem events.<br>This field is available if event acknowledgement is activated in *Administration* → *General*.<br>Supported since Zabbix 3.2.0.|
|*URL*|如果此处不为空，则在此处输入的URL可在点击*Monitoring → Triggers*的trigger name的时候链接于此。<br>可以在触发器URL字段 - {TRIGGER.ID}, 多个[{HOST.\*}](/manual/appendix/macros/supported_by_location)宏（Zabbix3.0.0以后的版本）和用户宏（Zabbix3.0.0以后的版本）中使用宏。|
|*Description*|文本字段用来提供更多关于触发器的信息。可能包含修复特定问题的说明、相关负责人的联系方式等。<br>*从Zabbix2.2开始*，描述可能包含与触发器名称相同的一组宏。|
|*Enabled*|如果需要，取消选中此框将禁用触发器。|

**Dependencies**标签页包含触发器的所有[dependencies](dependencies)。

点击*Add*来添加一个新的依赖关系。

::: noteclassic
你也可以打开一个现有的触发器，点击*Clone*按钮，以一个不同的名称保存为新的触发器。
:::
