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

4 批量更新

概览

有时您可能想要同时更改多个模板的某些属性。您可以使用批量更新功能,无需打开每个模板进行独立编辑。

使用批量更新

批量更新一些模板,操作如下:

  • 模板列表 中,标记要更新模板前的复选框
  • 点击下方 更新 按钮
  • 页面跳转到带有所需属性 (模板, 标记, 值映射)的选项卡
  • 标记要更新的任何属性的复选框,并为它们输入一个新值

当选择更新 模板链接 复选框时,将有以下选项可以选择:

  • 链接 - 指定要链接的附加模板。
  • 替换 - 指定要链接的模板,同时取消链接之前链接到模板的任何模板。
  • 取消链接 - 指定要取消链接的模板。

快捷搜索 -在搜索框输入模板名关键字后,将出现一个提供匹配模板的下拉菜单。只需向下滚动选择要_链接/取消链接_的模板即可。

当无链接时清除选项不仅允许取消任何先前关联的模板的关联,而且还可以删除从它们继承的所有元素(监控项、触发器等)。

当选择更新 主机群组 复选框时,将有以下选项可以选择:

  • 添加 - 允许从现有的主机组中指定额外的主机组或为模板输入全新的主机组。
  • 替换 - 将从任何现有主机组中删除模板,并将它们替换为在此字段中指定的模板(现有或新的主机组)。
  • 移除 - 将从模板中删除特定的主机组。

这些字段是自动完成的 - 在搜索框输入关键字后,会自动提供一个匹配主机组的下拉列表。如果主机组是新创建的,它也会出现在下拉列表中,并且在字符串后面用新(new)表示。数量较多时,只需向下滚动选择即可。

用户宏, {INVENTORY.*} , {HOST.HOST}, {HOST.NAME}, {HOST.CONN}, {HOST.DNS}, {HOST.IP}, {HOST.PORT} 和{HOST.ID}在标签中被支持。具有相同名称但不同值的标签不被认为是“重复”,可以添加到相同的模板中。

当选择更新 复选框时,将有以下选项可以选择:

  • 添加- 允许为模板指定额外的用户宏。如果选中更新现有的复选框,则只更新指定宏名称的值、类型和描述。反之,如果模板中已经存在同名的宏,则不会更新该宏。
  • 更新 - 将替换列表中指定的宏的值、类型和描述。如果选中添加缺失复选框,则模板上先前不存在的宏将被添加为新的宏。反之,则只有模板中已经存在的宏才会被更新。
  • 移除 - 将从模板中删除指定的宏。如果选中除选中复选框,则除列表中指定的宏之外的所有宏都将被删除。如果未选中,则只删除列表中指定的宏。
  • 全部移除 - 将从模板中删除所有的宏。 如果未选中我确认移除所有宏复选框,将弹出需要选择该选项的警告提示框。

当选择更新 值映射 复选框时,将有以下选项可以选择:

  • 添加 - 添加值映射到模板。如果选中更新现有的复选框,只更新指定值映射中的所有属性。反之,如果值映射已存在,将不会更新。
  • 更新 - 更新已存在值映射。如果选中添加缺失复选框,则模板上先前不存在的值映射将被添加为新的值映射。反之,则只有模板中已经存在的值映射才会被更新。
  • 重命名 - 为已存在的值映射更换新的名称。
  • 移除 - 将从模板中删除指定的值映射。如果选中除选中复选框,则列表中指定的值映射之外的所有宏都将被删除。
  • 全部移除 - 将从模板中删除所有的值映射。 如果未选中我确认移除所有值映射复选框,将弹出需要选择该选项的警告提示框。

完成所有需要的更改后,点击更新按钮。所有选择模板的属性都会相应地更新。

The Template tab contains general template mass update options.

The following options are available when selecting the respective button for the Template groups update:

  • Add - allows to specify additional template groups from the existing ones or enter completely new template groups for the templates;
  • Replace - will remove the template from any existing template groups and replace them with the one(s) specified in this field (existing or new template groups);
  • Remove - will remove specific template groups from templates.

These fields are auto-complete - starting to type in them offers a dropdown of matching template groups. If the template group is new, it also appears in the dropdown and it is indicated by (new) after the string. Just scroll down to select.

The Tags tab allows you to mass update template-level tags.

User macros, {INVENTORY.*} macros, {HOST.HOST}, {HOST.NAME}, {HOST.CONN}, {HOST.DNS}, {HOST.IP}, {HOST.PORT} and {HOST.ID} macros are supported in tags. Note that tags with the same name, but different values are not considered 'duplicates' and can be added to the same template.

The Macros tab allows you to mass update template-level macros.

The following options are available when selecting the respective button for macros update:

  • Add - allows to specify additional user macros for the templates. If Update existing checkbox is checked, value, type and description for the specified macro name will be updated. If unchecked, if a macro with that name already exist on the template(s), it will not be updated.
  • Update - will replace values, types and descriptions of macros specified in this list. If Add missing checkbox is checked, macro that didn't previously exist on a template will be added as new macro. If unchecked, only macros that already exist on a template will be updated.
  • Remove - will remove specified macros from templates. If Except selected box is checked, all macros except specified in the list will be removed. If unchecked, only macros specified in the list will be removed.
  • Remove all - will remove all user macros from templates. If I confirm to remove all macros checkbox is not checked, a new popup window will open asking to confirm removal of all macros.

The Value mapping tab allows you to mass update value mappings.

Buttons with the following options are available for value map update:

  • Add - add value maps to the templates. If you mark Update existing, all properties of the value map with this name will be updated. Otherwise, if a value map with that name already exists, it will not be updated.
  • Update - update existing value maps. If you mark Add missing, a value map that didn't previously exist on a template will be added as a new value map. Otherwise only the value maps that already exist on a template will be updated.
  • Rename - give new name to an existing value map.
  • Remove - remove the specified value maps from the templates. If you mark Except selected, all value maps will be removed except the ones that are specified.
  • Remove all - remove all value maps from the templates. If the I confirm to remove all value maps checkbox is not marked, a new popup window will open asking to confirm the removal.

Add from template and Add from host options are available for value mapping add/update operations. They allow to select value mappings from a template or a host respectively.

When done with all required changes, click on Update. The attributes will be updated accordingly for all the selected templates.