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

1 服务树

服务树在 Services->Services 菜单部分配置。在右上角,从 View 切换到 Edit 模式。

配置 新服务,请单击右上角的 Create service 按钮。

要快速添加子服务,您也可以按父服务旁边的加号图标。这将打开相同的服务配置表单,但将预先填写父服务参数。

服务配置

Service 选项卡中,指定所需的服务参数:

所有必填输入字段均标有红色星号。

参数 说明
Name 服务名称。
Parent services 服务所属的父服务。
如果您要添加最高级别的服务,请将此字段留空。
一个服务可以有多个父服务。在这种情况下,它将显示在每个父服务下的服务树中。
Problem tags 指定标签将问题数据映射到服务:
Equals - 包括指定的标签名和值(区分大小写)
Contains - 包括指定的标签名,其中标签值包含输入的字符串(子字符串的匹配不区分大小写)
标签名的匹配始终区分大小写。
Sort order 显式的排序顺序,最低的排第一位。
Status calculation rule 状态计算规则:
Most critical if all children have problems - 如果所有子节点都有问题,则根据子节点中最严重的问题对服务状态进行着色。
Most critical of child nodes - 根据子节点中最严重的问题对服务状态进行着色
Set status to OK - 不计算服务状态
勾选下面的 高级配置 复选框以配置其他状态计算规则。
Description 服务说明。
Advanced configuration 勾选复选框以访问 高级配置 选项。

高级配置

参数 说明
Additional rules 单击 Add 以定义其他状态计算规则。
Set status to 如果 condition 匹配,则将服务状态设置为OK(默认)、Not classifiedInformationWarningAverageHighDisaster
Condition 选择子服务的条件:
如果至少 (N) 个子服务具有 (Status) 表示的状态或以上状态
如果至少 (N%) 的子服务具有 (Status) 表示的状态或以上状态
如果少于 (N) 个子服务具有 (Status) 表示的状态或以下状态
如果少于 (N%) 的子服务具有 (Status) 表示的状态或以下状态
如果具有 (Status) 状态的子服务的权重至少为 (W)
如果具有 (Status) 状态的子服务的权重至少为 (N%)
如果具有 (Status) 状态的子服务的权重小于 (W)
如果具有 (Status) 状态的子服务的权重少于 (N%)

如果指定了多个条件,并且情况与多个条件匹配,则将设置最高的严重性。
N (W) 在 condition 中设置 N 或 W (1-100000) 或 N% (1-100) 的值。
Status 选择 condition 中 Status 的值:OK (默认)、Not classifiedInformationWarningAverageHighDisaster
Status propagation rule 将服务状态传播到父服务的规则:
As is - 传播状态没有变化
Increase by - 您可以将传播的状态增加 1 到 5 个严重性
Decrease by - 您可以将传播的状态减少 1 到 5 个严重性
Ignore this service - 状态根本不会传播到父服务
Fixed status - 状态以静态方式传播,即始终保持不变
Weight 服务的权重(0(默认)到1000000之间的整数)。

附加状态计算规则只能用于将严重级别提高到根据 Status calculation rule 参数计算的级别之上。如果根据 additional rules,状态应为警告,但 Status calculation rule 状态为灾难 - 服务将具有灾难状态。

Tags 选项卡包含 服务级别标签。服务级别标签用于标识服务。这种类型的标签不用于将问题映射到服务(为此,使用第一个选项卡中的 问题标签)。

Child services 选项卡允许指定依赖服务。单击 Add 从现有服务列表中添加服务。如果要添加新的子服务,请先保存此服务,然后单击刚刚创建的服务旁边的加号图标。

标签

服务中有两种不同类型的标签:

  • 服务标签
  • 问题标签

服务标签

服务标签用于将服务与 service actionsSLA 相匹配。这些标签在 Tabs 服务配置选项卡中指定。 对于映射SLA,使用 OR 逻辑:如果服务至少有一个匹配的标签,则将其映射到SLA。 在服务操作中,映射规则是可配置的,可以使用 ANDOR、或 AND/OR 逻辑。

问题标签

问题标签用于匹配问题和服务。这些标签在主服务配置选项卡中指定。

只有最低层次级别的子服务可以定义问题标签并直接关联问题。如果问题标签匹配,服务状态将更改为与问题相同的状态。在多个问题的情况下,服务将具有最严重的状态。然后根据状态计算规则基于子服务状态计算父服务的状态。

如果指定了多个标签,则使用 AND 逻辑:问题必须将服务配置中指定的所有标签都映射到服务。

Zabbix 中的问题从模板、主机、项目、Web 场景和触发器的整个链中继承标签。这些标签中的任何一个都可用于匹配问题与服务。

示例:

问题 Web camera 3 is down 有标签 type:video surveillancefloor:1stname:webcam 3 ,状态为 Warning

服务 Web camera 3 具有指定的唯一问题标签: name:webcam 3

检测到此问题时,服务状态将从 OK 变为 Warning

如果服务 Web camera 3 有问题标签 name:webcam 3floor:2nd,则在检测到问题时不会更改其状态,因为仅部分条件满足。

Modifying existing services

The buttons described below are visible only when Services section is in the Edit mode.

To edit an existing service, press the pencil icon next to the service.

To clone an existing service, press the pencil icon to open its configuration and then press Clone button. When a service is cloned, its parent links are preserved, while the child links are not.

To delete a service, press on the x icon next to it. When you delete a parent service, its child services will not be deleted and will move one level higher in the service tree (1st level children will get the same level as the deleted parent service).

Two buttons below the list of services offer some mass-editing options:

  • Mass update - mass update service properties
  • Delete - delete the services

To use these options, mark the checkboxes before the respective services, then click on the required button.