这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
2022 Zabbix中国峰会
2022 Zabbix中国峰会

1 配置模板

概述

配置模板需要首先通过定义一些常规参数来创建模板,然后添加实体(监控项,触发器,图表等)。

创建模板

要创建模板,请执行以下操作:

  • 转到配置→模板
  • 点击创建模板
  • 编辑模板属性

模板选项卡包含常规模板属性。

所有必填字段都标有红色星号。

模板属性:

参数 描述
模板名称 唯一的模板名称。 允许使用字母数字、空格、点、破折号和下划线。 但是,空格是不允许在首尾使用。
可见名称 如果你设置了此名称,那么它将在列表,地图等中可见的。
模板 将一个或多个“嵌套”模板链接到此模板。 所有实体(项目、触发器、图表等)都将从链接的模板中继承。
要链接新模板,请开始在链接新模板字段中输入模板名称。 将出现匹配模板列表; 向下滚动以选择。 或者,您可以单击字段旁边的 选择 并从弹出窗口的列表中选择模板。 在保存或更新模板配置表单时,在 链接新模 字段中选择的模板将被链接。
要取消链接模板,请使用 链接模板 块中的两个选项之一 :
取消链接 - 取消链接模板,但保留其监控项、触发器和图形
取消链接并清除 - 取消链接模板并删除其所有监控项、触发器和图形
群组 模板所属的主机/模板组。
描述 输入模板说明。

标签 选项卡允许您定义模板级别标签。链接了此模板的所有主机的所有问题,将使用此处输入的标签。

标签支持用户宏、{INVENTORY.*} 宏, {HOST.HOST}, {HOST.NAME},{HOST.CONN}, {HOST.DNS}, {HOST.IP}, {HOST.PORT} 和 {HOST.ID} 宏。

选项卡允许您将模板级 用户宏 定义为名称-值键值对。 请注意,宏的值可以保存为纯文本、机密文本或 Vault秘钥。 还支持添加描述。

如果选择了继承模板的宏选项,则还可以从链接的模板和全局宏中查看宏。在这里,模板的所有定义的用户宏都显示了它们所决定的值以及它们的起源。

为方便起见,提供了相应模板和全局宏配置的链接。也可以在模板级别上编辑嵌套模板/全局宏,有效地创建模板上宏的副本。

值映射选项卡允许在 值映射中配置监控项数据的人性化展示。

按钮:

添加模板。添加的模板应该出现在列表中。
更新现有模板的属性。
根据当前模板的属性创建另一个模板,包括从链接模板继承的实体(监控项,触发器等)
基于当前模板的属性创建另一个模板,包括从链接的模板继承并直接附加到当前模板的实体(监控项,触发器等)。
删除模板; 模板(监控项,触发器等)的实体与链接的主机保留。
从链接的主机中删除模板及其所有实体。
取消编辑模板属性。

创建一个模板,可以开始添加一些实体。

监控项必须首先添加到模板中。如果没有相应的监控项,则无法添加触发器和图形。

添加监控项,触发器,图形

要向模板添监控项,请执行以下操作:

  • 转到配置→主机(或模板
  • 单击所需主机/模板行中的监控项
  • 标记要添加到模板的监控项的复选框
  • 点击监控项列表下面的复制
  • 选择要复制的监控项的模板(或模板组),然后单击复制

所有选定的监控项都应该被复制到模板中。

添加触发器和图形以类似的方式完成(分别从触发器和图形列表),请记住,只有在首先添加所需监控项时,才能添加它们。

添加仪表盘

要在配置 → 模板中添加仪表盘,请执行以下操作:

  • 点击模板行中的仪表盘
  • 按照通常的配置仪表盘的方法配置仪表盘

可以包含在模板仪表板中的小部件有:经典图形、图形原型、时钟、纯文本、URL。

有关访问从模板仪表板创建的主机仪表板的详细信息,请参阅主机仪表盘

配置低级别自动发现规则

请参阅手册的低级别自动发现部分。

添加Web场景

在模板的配置 → 模板中添加Web场景,请执行以下操作:

  • 点击模板行中的Web
  • 按照配置Web场景的通常方式配置Web场景

Creating a template group

Only Super Admin users can create template groups.

To create a template group in Zabbix frontend, do the following:

  • Go to: Configuration → Template groups
  • Click on Create template group in the upper right corner of the screen
  • Enter the group name in the form

To create a nested template group, use the '/' forward slash separator, for example Linux servers/Databases/MySQL. You can create this group even if none of the two parent template groups (Linux servers/Databases/) exist. In this case creating these parent template groups is up to the user; they will not be created automatically.
Leading and trailing slashes, several slashes in a row are not allowed. Escaping of '/' is not supported.

Once the group is created, you can click on the group name in the list to edit group name, clone the group or set additional option:

Apply permissions to all subgroups - mark this checkbox and click on Update to apply the same level of permissions to all nested template groups. For user groups that may have had differing permissions assigned to nested template groups, the permission level of the parent template group will be enforced on the nested groups. This is a one-time option that is not saved in the database.

Permissions to nested template groups

  • When creating a child template group to an existing parent template group, user group permissions to the child are inherited from the parent (for example, when creating Databases/MySQL if Databases already exists)
  • When creating a parent template group to an existing child template group, no permissions to the parent are set (for example, when creating Databases if Databases/MySQL already exists)