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

4 主机

概述

导出(exported) 的主机具有许多相关对象和对象关系。

主机导出的内容包含:

  • 链接的主机组
  • 主机数据
  • 模板链接
  • 主机组链接
  • 主机接口
  • 直接链接的应用集
  • 直接链接的监控项
  • 直接链接的触发器
  • 直接链接的图形
  • 直接链接的具有所有原型的发现规则
  • 直接链接的web场景
  • 主机宏
  • 主机资产清单数据
  • 值映射

导出

要导出主机,请执行以下操作:

  • 前往: ConfigurationHosts
  • 标记要导出的主机的复选框
  • 单击列表下方的导出

根据选定的格式,主机将导出到具有默认名称的本地文件:

  • zabbix_export_hosts.yaml - 导出YAML格式 (默认导出)
  • zabbix_export_hosts.xml - 导出XML格式
  • zabbix_export_hosts.json - 导出JSON格式

导入

导入主机,按照如下操作:

  • 切换到:配置(Configuration)主机(Hosts)
  • 单击右侧的_导入(Import)_按钮
  • 选择导入文件
  • 标记导入规则里的必选项
  • 单击_导入(Import)_按钮

导入的成功或失败消息将显示在前端。

导入规则:

规则 描述
更新已经存在 现有元素将使用从导入文件中获取的数据进行更新。否则它们将不会被更新。
创建新的 导入将使用导入文件中的数据添加新元素。否则它就不会添加它们。
删除缺失值 导入将删除导入文件中不存在的现有元素。否则它不会移除它们
如果为模板链接标记了Delete missing,则导入文件中不存在的现有模板链接将与从可能未链接的模板继承的所有实体(监控项、触发器等)一起从主机中删除。

导出格式

导出格式使用YAML:

zabbix_export:
         version: '6.0'
         date: '2021-09-28T12:20:07Z'
         groups:
           -
             uuid: f2481361f99448eea617b7b1d4765566
             name: 'Discovered hosts'
           -
             uuid: 6f6799aa69e844b4b3918f779f2abf08
             name: 'Zabbix servers'
         hosts:
           -
             host: 'Zabbix server 1'
             name: 'Main Zabbix server'
             templates:
               -
                 name: 'Linux by Zabbix agent'
               -
                 name: 'Zabbix server health'
             groups:
               -
                 name: 'Discovered hosts'
               -
                 name: 'Zabbix servers'
             interfaces:
               -
                 ip: 192.168.1.1
                 interface_ref: if1
             items:
               -
                 name: 'Zabbix trap'
                 type: TRAP
                 key: trap
                 delay: '0'
                 history: 1w
                 preprocessing:
                   -
                     type: MULTIPLIER
                     parameters:
                       - '8'
                 tags:
                   -
                     tag: Application
                     value: 'Zabbix server'
                 triggers:
                   -
                     expression: 'last(/Zabbix server 1/trap)=0'
                     name: 'Last value is zero'
                     priority: WARNING
                     tags:
                       -
                         tag: Process
                         value: 'Internal test'
             tags:
               -
                 tag: Process
                 value: Zabbix
             macros:
               -
                 macro: '{$HOST.MACRO}'
                 value: '123'
               -
                 macro: '{$PASSWORD1}'
                 type: SECRET_TEXT
             inventory:
               type: 'Zabbix server'
               name: yyyyyy-HP-Pro-3010-Small-Form-Factor-PC
               os: 'Linux yyyyyy-HP-Pro-3010-Small-Form-Factor-PC 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64'
             inventory_mode: AUTOMATIC
         graphs:
           -
             name: 'CPU utilization server'
             show_work_period: 'NO'
             show_triggers: 'NO'
             graph_items:
               -
                 drawtype: FILLED_REGION
                 color: FF5555
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,steal]'
               -
                 sortorder: '1'
                 drawtype: FILLED_REGION
                 color: 55FF55
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,softirq]'
               -
                 sortorder: '2'
                 drawtype: FILLED_REGION
                 color: '009999'
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,interrupt]'
               -
                 sortorder: '3'
                 drawtype: FILLED_REGION
                 color: '990099'
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,nice]'
               -
                 sortorder: '4'
                 drawtype: FILLED_REGION
                 color: '999900'
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,iowait]'
               -
                 sortorder: '5'
                 drawtype: FILLED_REGION
                 color: '990000'
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,system]'
               -
                 sortorder: '6'
                 drawtype: FILLED_REGION
                 color: '000099'
                 calc_fnc: MIN
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,user]'
               -
                 sortorder: '7'
                 drawtype: FILLED_REGION
                 color: '009900'
                 item:
                   host: 'Zabbix server 1'
                   key: 'system.cpu.util[,idle]'

元素标签

下表解释了元素标签值。

主机标签
元素 元素属性 是否必须 类型 适用范围1 描述
groups x 主机群组根元素。
name x string 主机群组名称。
hosts - 主机的根元素。
host x string 唯一的主机名。
name - string 可见的主机名
description - text 主机描述。
status - string 0 - 启用(默认)
1 - 禁用
主机状态。
ipmi_authtype - string -1 - DEFAULT (默认)
0 - NONE
1 - MD2
2 - MD5
4 - STRAIGHT
5 - OEM
6 - RMCP_PLUS
IPMI会话身份验证类型。
ipmi_privilege - string 1 - CALLBACK
2 - USER (默认)
3 - OPERATOR
4 - ADMIN
5 - OEM
IPMI 会话特权级别。
ipmi_username - string IPMI检查的用户名。
ipmi_password - string IPMI检查的密码。
proxy - Proxy.
name x string 监视主机的Proxy(如果有)的名称。
templates - 链接模板的根元素。
name x string 模板名称
interfaces - 主机接口的根元素。
default - string 0 - NO
1 - YES (默认)
这是否是主主机接口
主机上只能有一种类型的主接口。
type - string 1 - ZABBIX (默认)
2 - SNMP
3 - IPMI
4 - JMX
接口类型
useip - string 0 - NO
1 - YES (默认)
是否使用IP作为连接主机的接口(如果不使用,将使用DNS)。
ip - string IP地址,可以是IPv4或IPv6

如果通过IP进行连接,则需要。
dns - string DNS名称

如果通过DNS进行连接,则需要。
port - string 端口号。支持用户宏。
interface_ref x string Format: if<N> 要在监控项中使用的接口引用名称。
details - 接口详细信息的根元素。
version - string 1 - SNMPV1
2 - SNMP_V2C (默认)
3 - SNMP_V3
使用此SNMP版本。
community - string SNMP 团体子.

SNMPv1和SNMPv2监控项需要。
contextname - string SNMPv3 上下文名称.

仅由SNMPv3监控项使用。
securityname - string SNMPv3 安全名称.

仅由SNMPv3监控项使用。
securitylevel - string 0 - NOAUTHNOPRIV (默认)
1 - AUTHNOPRIV
2 - AUTHPRIV
SNMPv3 安全等级。

仅由SNMPv3监控项使用。
authprotocol - string 0 - MD5 (default)
1 - SHA1
2 - SHA224
3 - SHA256
4 - SHA384
5 - SHA512
SNMPv3 身份验证协议。

仅由SNMPv3监控项使用。
authpassphrase - string SNMPv3 身份验证密码短语。

仅由SNMPv3监控项使用。
privprotocol - string 0 - DES (default)
1 - AES128
2 - AES192
3 - AES256
4 - AES192C
5 - AES256C
SNMPv3 私密协议.

仅由SNMPv3监控项使用。
privpassphrase - string SNMPv3 私密码短语.

仅由SNMPv3监控项使用。
bulk - string 0 - NO
1 - YES (默认)
对SNMP使用批量请求。
items - 监控项根元素
对监控项元素标签值, 查看 监控项 标签.
tags - 主机标签的根元素。
tag x string 标签名称。
value - string 标签值。
macros - 宏的根元素。
macro x 用户宏名称。
type - string 0 - TEXT (默认)
1 - SECRET_TEXT
2 - VAULT
宏类型。
value - string 用户宏值。
description - string 用户宏描述。
inventory - 主机资产的根元素。
<inventory_property> - 单独的资产属性。

所有可用的资产的属性都列在各自的标签下, e.g. <type>, <name>, <os> (看到上面的例子)。
inventory_mode - string -1 - DISABLED
0 - MANUAL (默认)
1 - AUTOMATIC
资产模式。
valuemaps - 值映射的根元素。
name x string 值映射的名称
mapping - 映射的根元素。
value x string 映射的值。
newvalue x string 映射的新值。

Host interfaces

Element Type Description
default string Whether this is the primary host interface. Note that there can be only one primary interface of one type on a host.
Possible values:1 NO (0), YES (1, default).
type string Interface type.
Possible values:1 ZABBIX (1, default), SNMP (2), IPMI (3), JMX (4).
useip string Whether to use IP as the interface for connecting to the host (otherwise, DNS will be used).
Possible values:1 NO (0), YES (1, default).
ip string (required for IP connections) IP address (IPv4 or IPv6).
dns string (required for DNS connections) DNS name.
port string Port number.
details Root element for interface details.
version string Use this SNMP version.
Possible values:1 SNMPV1 (1), SNMP_V2C (2, default), SNMP_V3 (3).
community string (required for SNMPv1 and SNMPv2 items) SNMP community.
max_repetitions string Max repetition value for native SNMP bulk requests (GetBulkRequest-PDUs).
Supported for SNMPv2 and SNMPv3 items (discovery[] and walk[] items).
Default: 10.
contextname string SNMPv3 context name.
Supported for SNMPv3 items.
securityname string SNMPv3 security name.
Supported for SNMPv3 items.
securitylevel string SNMPv3 security level.
Supported for SNMPv3 items.
Possible values:1 NOAUTHNOPRIV (0, default), AUTHNOPRIV (1), AUTHPRIV (2).
authprotocol string SNMPv3 authentication protocol.
Supported for SNMPv3 items.
Possible values:1 MD5 (0, default), SHA1 (1), SHA224 (2), SHA256 (3), SHA384 (4), SHA512 (5).
authpassphrase string SNMPv3 authentication passphrase.
Supported for SNMPv3 items.
privprotocol string SNMPv3 privacy protocol.
Supported for SNMPv3 items.
Possible values:1 DES (0, default), AES128 (1), AES192 (2), AES256 (3), AES192C (4), AES256C (5).
privpassphrase string SNMPv3 privacy passphrase.
Supported for SNMPv3 items.
bulk string Use bulk requests for SNMP.
Possible values:1 NO (0), YES (1, default).
interface_ref string Interface reference name to be used in items (format: if<N>).

See also: Host interface object (refer to the relevant property with a matching name).

主机监控项标签
元素 元素属性 是否必须 类型 适用范围1 描述
items - 监控项根元素。
name x string 监控名称。
type - string 0 - ZABBIX_PASSIVE (默认)
2 - TRAP
3 - SIMPLE
5 - INTERNAL
7 - ZABBIX_ACTIVE
10 - EXTERNAL
11 - ODBC
12 - IPMI
13 - SSH
14 - TELNET
15 - CALCULATED
16 - JMX
17 - SNMP_TRAP
18 - DEPENDENT
19 - HTTP_AGENT
20 - SNMP_AGENT
21 - ITEM_TYPE_SCRIPT
监控项类型。
snmp_oid - string SNMP OID.

SNMP监控项需要。
key x string 监控项键值。
delay - string 默认: 1m 监控项的更新间隔

请注意,对于trapper监控项,“延迟”将始终为“0”

接受秒或带有后缀的时间单位(30s、1m、2h、1d)。
可选一个或多个 custom intervals 可以指定为灵活的时间间隔或计划
多个间隔用分号分隔。
可以适用用户宏。一个宏必须填充整个字段。 不支持字段中的多个宏或与文本混合的宏。
灵活的间隔可以写成两个用正斜杠分隔的宏(例如,“{$FLEX_INTERVAL}/{$FLEX_PERIOD}”)。
history - string 默认: 90d 历史数据应存储多长时间的时间单位。带有后缀、用户宏或LLD宏的时间单位。
trends - string 默认: 365d 趋势数据应存储多长时间的时间单位。带有后缀、用户宏或LLD宏的时间单位。
status - string 0 - ENABLED (默认)
1 - DISABLED
监控项状态。
value_type - string 0 - FLOAT
1 - CHAR
2 - LOG
3 - UNSIGNED (默认)
4 - TEXT
接收值类型。
allowed_hosts - string 允许发送监控项数据的主机的IP地址列表(逗号分隔)

由trapper和HTTP代理项使用。
units - string 返回值的单位(bps, B, etc)。
params - text 其他参数取决于监控项的类型:
脚本、SSH和Telnet监控项的已执行脚本
-SQL查询数据库监控项
-可计算监控项的公式。
ipmi_sensor - string IPMI 传感器.

仅用于IPMI监控项。
authtype - string SSH agent监控项的身份验证类型:
0 - PASSWORD (默认)
1 - PUBLIC_KEY

HTTP agent监控项的身份验证类型:
0 - NONE (默认)
1 - BASIC
2 - NTLM
身份验证类型

仅由SSH和HTTP代理项使用。
username - string 用于身份验证的用户名。
用于简单检查, SSH, Telnet, database 监控, JMX and HTTP agent 监控项.

SSH和Telnet监控项所需。
当JMX代理使用时,密码也应该与用户名一起指定,或者两个属性都应该留空。
password - string 验证密码。
用于简单检查, SSH, Telnet, database 监控, JMX and HTTP agent 监控项。

当JMX代理使用时,用户名也应该与密码一起指定,或者两个属性都应该留空。
publickey - string 公钥文件的名称

SSH代理监控项需要。
privatekey - string 私钥文件的名称

SSH代理监控项需要。
description - text 监控项描述。
inventory_link - string 0 - NONE

大写的主机资产字段名。 例如:
4 - ALIAS
6 - OS_FULL
14 - HARDWARE
等等。
由监控项填充的主机资产字段。

参考 主机资产页面 获取受支持的主机资产字段及其ID的列表。
logtimefmt - string 日志监控项中的时间格式
仅由日志监控项使用。
interface_ref - string Format: if<N> 对主机接口的引用。
jmx_endpoint - string JMX 终端。

仅JMX agent监控项需要。
url - string URL 字符串。

仅HTTP agent 监控项需要。
allow_traps - string 0 - NO (默认)
1 - YES
允许像在Traper监控项中一样填充值。

仅HTTP agent监控项需要。
follow_redirects - string 0 - NO
1 - YES (默认)
在共享数据时遵循HTTP响应重定向

仅HTTP agent监控项使用。
headers - HTTP(S)请求头的根元素,其中头名称用作键,头值用作值。
仅HTTP agent监控项使用。
name x string 头名称
value x string 头值
http_proxy - string HTTP(S) proxy连接字符串。

仅HTTP agent监控项使用。
output_format - string 0 - RAW (默认)
1 - JSON
如何处理回应。

仅HTTP agent监控项使用。
post_type - string 0 - RAW (默认)
2 - JSON
3 - XML
post数据体的类型。

仅HTTP agent监控项使用。
posts - string HTTP(S)请求正文数据。

仅HTTP agent监控项使用。
query_fields - 查询参数的根元素。

仅HTTP agent监控项使用。
name x string 参数名称。
value - string 参数值。
request_method - string 0 - GET (默认)
1 - POST
2 - PUT
3 - HEAD
请求方法。

仅HTTP agent监控项使用。
retrieve_mode - string 0 - BODY (默认)
1 - HEADERS
2 - BOTH
应该存储响应的哪一部分

仅HTTP agent监控项使用。
ssl_cert_file - string 公共 SSL 密钥文件路径。

仅HTTP agent监控项使用。
ssl_key_file - string 私有 SSL 密钥文件路径。

仅HTTP agent监控项使用。
ssl_key_password - string SSL密钥文件的密码。

仅HTTP agent监控项使用。
status_codes - string 所需HTTP状态代码的范围,用逗号分隔。支持用户宏。
例如: 200,200-{$M},{$M},200-400

仅HTTP agent监控项使用。
timeout - string 监控项数据轮询请求超时。支持用户宏。

仅HTTP agent监控项使用。
verify_host - string 0 - NO (默认)
1 - YES
验证URL中的主机名是否位于主机证书的公用名字段或使用者备用名字段中。

仅HTTP agent监控项使用。
verify_peer - string 0 - NO (默认)
1 - YES
验证主机证书是否真实。

仅HTTP agent监控项使用。
parameters - 用户定义参数的根元素。

仅HTTP agent监控项使用。
name x string 参数名称。

仅HTTP agent监控项使用。
value - string 参数值。

仅HTTP agent监控项使用。
value map - 值映射。
name x string 要用于监控项的值映射的名称。
preprocessing - 监控项预处理的根元素。
step - 单个监控项值预处理步骤。
type x string 1 - MULTIPLIER
2 - RTRIM
3 - LTRIM
4 - TRIM
5 - REGEX
6 - BOOL_TO_DECIMAL
7 - OCTAL_TO_DECIMAL
8 - HEX_TO_DECIMAL
9 - SIMPLE_CHANGE (计算为 (接收值以前的值))
10 - CHANGE_PER_SECOND (计算为 (接收值以前的值)/(现在时间-最近一次检查时间))
11 - XMLPATH
12 - JSONPATH
13 - IN_RANGE
14 - MATCHES_REGEX
15 - NOT_MATCHES_REGEX
16 - CHECK_JSON_ERROR
17 - CHECK_XML_ERROR
18 - CHECK_REGEX_ERROR
19 - DISCARD_UNCHANGED
20 - DISCARD_UNCHANGED_HEARTBEAT
21 - JAVASCRIPT
22 - PROMETHEUS_PATTERN
23 - PROMETHEUS_TO_JSON
24 - CSV_TO_JSON
25 - STR_REPLACE
26 - CHECK_NOT_SUPPORTED
27 - XML_TO_JSON
监控项值预处理步骤的类型。
parameters - 监控项值预处理步骤参数的根元素。
parameter x string 监控项值预处理步骤的单个参数。
error_handler - string 0 - ORIGINAL_ERROR (默认)
1 - DISCARD_VALUE
2 - CUSTOM_VALUE
3 - CUSTOM_ERROR
预处理步骤失败时使用的操作类型。
error_handler_params - string 与一起使用的错误处理程序参数 'error_handler'.
master_item - 单个监控项的被依赖主监控项。

依赖监控项所需。
key x string 依赖监控项主监控项键值

最多允许递归3个依赖项,且依赖项的最大计数等于29999。
triggers - 简单触发器的根元素。
* 有关触发器元素标记值,请参见主机 触发器标签.*
tags - 监控项标签的根元素。
tag x string 标签的名称
value - string 标签值。
Host item value preprocessing steps
Element Type Description
type string (required) The item value preprocessing step type.
Possible values:1 MULTIPLIER (1), RTRIM (2), LTRIM (3), TRIM (4), REGEX (5), BOOL_TO_DECIMAL (6), OCTAL_TO_DECIMAL (7), HEX_TO_DECIMAL (8), SIMPLE_CHANGE (9, calculated: received value - previous value), CHANGE_PER_SECOND (10, calculated: (received value - previous value)/(time now - time of last check)), XMLPATH (11), JSONPATH (12), IN_RANGE (13), MATCHES_REGEX (14), NOT_MATCHES_REGEX (15), CHECK_JSON_ERROR (16), CHECK_XML_ERROR (17), CHECK_REGEX_ERROR (18), DISCARD_UNCHANGED (19), DISCARD_UNCHANGED_HEARTBEAT (20), JAVASCRIPT (21), PROMETHEUS_PATTERN (22), PROMETHEUS_TO_JSON (23), CSV_TO_JSON (24), STR_REPLACE (25), CHECK_NOT_SUPPORTED (26), XML_TO_JSON (27), SNMP_WALK_VALUE (28), SNMP_WALK_TO_JSON (29), SNMP_GET_VALUE (30).
parameters (required) Root element for parameters of the item value preprocessing step.
parameter string Individual parameter of the item value preprocessing step.
error_handler string Action type used in case of preprocessing step failure.
Possible values:1 ORIGINAL_ERROR (0, default), DISCARD_VALUE (1), CUSTOM_VALUE (2), CUSTOM_ERROR (3).
error_handler_params string Error handler parameters.

See also: Item preprocessing object (refer to the relevant property with a matching name).

主机底层自动发现规则标签
元素 元素属性 是否必须 类型 适用范围1 描述
discovery_rules - 低级别自动发现根元素。
有关大多数图元标标签,请参见常规监控项的图元标签值。下面只描述特定于底层自动发现规则的标签。
type - string 0 - ZABBIX_PASSIVE (默认)
2 - TRAP
3 - SIMPLE
5 - INTERNAL
7 - ZABBIX_ACTIVE
10 - EXTERNAL
11 - ODBC
12 - IPMI
13 - SSH
14 - TELNET
16 - JMX
18 - DEPENDENT
19 - HTTP_AGENT
20 - SNMP_AGENT
监控项类型
lifetime - string 默认: 30d 在该时间段之后,不再发现的监控项将被删除。支持秒,带后缀的时间单位或用户宏。
filter 单个过滤器。
evaltype - string 0 - AND_OR (默认)
1 - AND
2 - OR
3 - FORMULA
用于检查底层自动发现规则筛选器条件的逻辑。
formula - string 过滤条件的自定义计算公式。
conditions - 过滤条件的根元素。
macro x string 底层自动发现宏名称
value - string 筛选值:正则表达式或全局正则表达式。
operator - string 8 - MATCHES_REGEX (默认)
9 - NOT_MATCHES_REGEX
条件操作者。
formulaid x character 用于从自定义表达式引用条件的任意唯一ID。只能包含大写字母。用户在修改过滤条件时必须定义ID,但在之后请求时将重新生成ID。
lld_macro_paths - 底层自动发现宏路径根元素。
lld_macro x string 底层自动发现宏名称
path x string 将分配给相应宏的值的选择器。
preprocessing - 底层自动发现值预处理。
step - 单个底层自动发现规则值预处理步骤。
有关大多数图元标签值,请参见主体监控值预处理的图元标签值。下面只描述特定于底层自动发现值预处理的标签。
type x string 5 - REGEX
11 - XMLPATH
12 - JSONPATH
15 - NOT_MATCHES_REGEX
16 - CHECK_JSON_ERROR
17 - CHECK_XML_ERROR
20 - DISCARD_UNCHANGED_HEARTBEAT
21 - JAVASCRIPT
23 - PROMETHEUS_TO_JSON
24 - CSV_TO_JSON
25 - STR_REPLACE
27 - XML_TO_JSON
监控项值预处理步骤的类型。
trigger_prototypes - 触发器原型的根元素。
有关触发器原型元素标签值,请参见常规 主机触发器 标签。
graph_prototypes - 图形原型的根元素。
有关图形原型元素标签值,请参见常规 主机图形 标签。
host_prototypes - 主机原型的根元素。
有关主体原型图元标记值,请参见常规主机 标签。
item_prototypes - 监控项原型的根元素。
有关监控项原型元素标记值,请参见常规 主机监控项 标签。
master_item - 单个监控项原型主监控项/监控项原型数据。
key x string 依赖监控项原型 主监控项/监控项原型 键值的值.

依赖项所需。
Host low-level discovery rule filters
Element Type Description
evaltype string Override filter condition evaluation method.
Possible values:1 AND_OR (0, default), AND (1), OR (2), FORMULA (3).
formula string Custom calculation formula for filter conditions.
conditions Root element for filter conditions.
macro string (required) The name of the low-level discovery macro to perform the check on.
value string Value to compare with.
operator string Condition operator.
Possible values:1 MATCHES_REGEX (8, default), NOT_MATCHES_REGEX (9).
formulaid string (required) Arbitrary unique ID that is used to reference a condition from the custom expression. Can only contain capital-case letters. The ID must be defined by the user when modifying filter conditions, but will be generated anew when requesting them afterward.

See also: LLD rule filter object (refer to the relevant property with a matching name).

Host low-level discovery rule override operations
Element Type Description
operationobject string Object to which the operation is applied.
Possible values:1 ITEM_PROTOTYPE (0), TRIGGER_PROTOTYPE (1), GRAPH_PROTOTYPE (2), HOST_PROTOTYPE (3).
operator string Override condition operator.
Possible values:1 EQUAL (1), NOT_EQUAL (2), LIKE (3), NOT_LIKE (4), REGEXP (5), NOT_REGEXP (6).
value string A regular expression or a string for the override condition operator.
status string Status of the object upon the override operation.
discover string Whether the object is added as a result of the discovery.
delay string Update interval set for the item prototype upon the override operation.
history string History storage period set for the item prototype upon the override operation.
trends string Trend storage period set for the item prototype upon the override operation.
severity string Trigger prototype severity set upon the override operation.
tags Root element for the tags set for the object upon the override operation.
tag string (required) Tag name.
value string Tag value.
templates Root element for the templates linked to the host prototype upon the override operation.
name string (required) Template name.
inventory_mode string Host prototype inventory mode set upon the override operation.

See also: LLD rule override operation object (refer to the relevant property with a matching name).

主机触发器标签
元素 元素属性 是否必须 类型 适用范围1 描述
triggers - 触发器根元素。
expression x string 触发器表达式。
recovery_mode - string 0 - EXPRESSION (默认)
1 - RECOVERY_EXPRESSION
2 - NONE
生成OK事件的基础。
recovery_expression - string 触发器恢复表达式。
name x string 触发器名称。
correlation_mode - string 0 - DISABLED (默认)
1 - TAG_VALUE
关联模式(无事件关联或标记的事件关联)。
correlation_tag - string 用于事件关联的标记名。
url - string 与触发器关联的URL。
status - string 0 - ENABLED (默认)
1 - DISABLED
触发器状态
priority - string 0 - NOT_CLASSIFIED (默认)
1 - INFO
2 - WARNING
3 - AVERAGE
4 - HIGH
5 - DISASTER
触发器等级。
description - text 触发器描述。
type - string 0 - SINGLE (默认)
1 - MULTIPLE
事件生成类型(单个问题事件或多个问题事件)。
manual_close - string 0 - NO (默认)
1 - YES
手动关闭问题事件。
dependencies - 依赖项的根元素。
name x string 依赖触发器名称。
expression x string 依赖触发表达式。
recovery_expression - string 依赖触发恢复表达式。
tags - 事件标签的根元素。
tag x string 标签名称。
value - string 标签值。
主机图形标签
元素 元素属性 是否必须 类型 范围1 描述
graphs - 图形的根元素。
name x string 图形名称。
width - integer 20-65535 (默认: 900) 图形宽度, 以像素为单位。用于预览和饼图/分解图。
height - integer 20-65535 (默认: 200) 图形高度,以像素为单位。用于预览和饼图/分解图。
yaxismin - double 默认: 0 Y轴最小值。

当'ymin_type_1'为固定值时使用。
yaxismax - double 默认: 0 Y轴最大值。

当'ymax_type_1'为固定值时使用。
show_work_period - string 0 - NO
1 - YES (默认)
突出非工作时间。

用于普通图和堆叠图。
show_triggers - string 0 - NO
1 - YES (默认)
将简单的触发器值显示为一行。

用于普通图和堆叠图。
type - string 0 - NORMAL (默认)
1 - STACKED
2 - PIE
3 - EXPLODED
图形类型。
show_legend - string 0 - NO
1 - YES (默认)
显示图例。
show_3d - string 0 - NO (默认)
1 - YES
开启3De风格。

用于饼图和分解饼图。
percent_left - double 默认:0 显示左轴的百分位线。

仅用于普通图形。
percent_right - double 默认:0 显示右轴的百分位线。

仅用于普通图形。
ymin_type_1 - string 0 - CALCULATED (默认)
1 - FIXED
2 - ITEM
Y轴的最小值。

用于普通图和堆叠图。
ymax_type_1 - string 0 - CALCULATED (默认)
1 - FIXED
2 - ITEM
Y轴最大值。

用于普通图和堆叠图。
ymin_item_1 - 个别监控项的细节。

当'ymin_type_1'为ITEM时需要。
host x string 监控项主机。
key x string 监控项键值。
ymax_item_1 - 个别监控项的细节。

当'ymax_type_1'为ITEM时需要。
host x string 监控项主机。
key x string 监控项键值。
graph_items x 图形监控项的根元素。
sortorder - integer 画秩序。 先画出较小的值。 可用于在另一个线或区域后面(或前面)画线或区域。
drawtype - string 0 - SINGLE_LINE (默认)
1 - FILLED_REGION
2 - BOLD_LINE
3 - DOTTED_LINE
4 - DASHED_LINE
5 - GRADIENT_LINE
图形监控项的绘制样式。

仅用于普通图形。
color - string 元素颜色(6个符号,十六进制)。
yaxisside - string 0 - LEFT (默认)
1 - RIGHT
将绘制图形监控项Y比例的图形的一边。

用于普通图和堆叠图。
calc_fnc - string 1 - MIN
2 - AVG (默认)
4 - MAX
7 - ALL(最小、平均和最大;
9 - LAST(仅用于饼图和分解饼图)
如果某监控项存在多个值,则绘制的数据。
type - string 0 - SIMPLE (默认)
2 - GRAPH_SUM (监控项的值代表整个饼图; 仅用于饼图和分解饼图)
监控项图形类型。
item x 单一监控项。
host x string 监控项主机。
key x string 监控项键值。
Host graph items
Element Type Description
sortorder integer Draw order. The smaller value is drawn first. Can be used to draw lines or regions behind (or in front of) another.
drawtype string Draw style of the graph item.
Supported for NORMAL graphs.
Possible values:1 SINGLE_LINE (0, default), FILLED_REGION (1), BOLD_LINE (2), DOTTED_LINE (3), DASHED_LINE (4), GRADIENT_LINE (5).
color string Element color (6 symbols, hex).
yaxisside string Side of the graph where the graph item's Y scale will be drawn.
Supported for NORMAL and STACKED graphs.
calc_fnc string Data to draw if more than one value exists for an item.
Possible values:1 MIN (1), AVG (2, default), MAX (4), ALL (7; minimum, average, and maximum; supported for simple graphs), LAST (9, supported for pie/exploded graphs).
type string Graph item type.
Possible values:1 SIMPLE (0, default), GRAPH_SUM (2; value of the item represents the whole pie; supported for pie/exploded graphs).
item (required) Individual item.
host string (required) Item host.
key string (required) Item key.

See also: Graph item object (refer to the relevant property with a matching name).

Host value maps

Element Type Description
uuid string (required) Unique identifier for this value map.
name string (required) Value map name.
mapping Root element for mappings.
type string Mapping match type.
Possible values:1 EQUAL (0, default), GREATER_OR_EQUAL (2), LESS_OR_EQUAL (3), IN_RANGE (4), REGEXP (5), DEFAULT (6).
value string Original value.
newvalue string (required) Value to which the original value is mapped to.

See also: Value map object (refer to the relevant property with a matching name).

主机web场景标签
元素 元素属性 是否必须 类型 适用范围1 描述
httptests - web场景的根元素。
name x string Web场景名称。
delay - string 默认: 1m 执行web场景的频率。 支持秒,带后缀的时间单位或用户宏。
attempts - integer 1-10 (默认: 1) 尝试执行web场景步骤的次数。
agent - string 默认: Zabbix agent客户端。Zabbix将模拟为选中的浏览器。 当一个网站为不同的浏览器返回不同的内容时,这是很有用的。
http_proxy - string 指定要使用的HTTP代理,格式如下:http://[username[:password]@]proxy.example.com[:port]
variables - 场景步骤中可能使用的场景级变量(宏)的根元素。
name x text 变量名称。
value x text 变量值。
headers - 执行请求时将发送的HTTP头的根元素。 报文头应该使用与HTTP协议中相同的语法列出。
name x text 头名称。
value x text 头值。
status - string 0 - ENABLED (默认)
1 - DISABLED
Web场景状态。
authentication - string 0 - NONE (默认)
1 - BASIC
2 - NTLM
认证方法。
http_user - string 用于基本认证、HTTP认证或NTLM认证的用户名。
http_password - string 用于基本、HTTP或NTLM身份验证的密码。
verify_peer - string 0 - NO (默认)
1 - YES
验证web服务的SSL证书。
verify_host - string 0 - NO (默认)
1 - YES
验证web服务证书的Common Name字段或Subject Alternate Name字段是否匹配。
ssl_cert_file - string 用于客户端认证的SSL证书文件名(必须为PEM格式)。
ssl_key_file - string 用于客户端认证的SSL私钥文件名(必须为PEM格式)。
ssl_key_password - string SSL私钥文件密码。
steps x web场景步骤的根元素。
name x string Web场景步骤名。
url x string URL监控。
query_fields - 查询字段的根元素——执行请求时将添加到URL的HTTP字段数组。
name x string 查询字段名。
value - string 查询字段值。
posts - HTTP POST变量为字符串(原始POST数据)或HTTP字段数组(表单字段数据)。
name x string Post 字段名。
value x string Post 字段值。
variables - 步骤级变量(宏)的根元素,应该在此步骤之后应用。

如果变量值有'regex:'前缀,那么它的值将根据'regex:'前缀后面的正则表达式模式从这一步返回的数据中提取。
name x string 变量名。
value x string 变量值。
headers - 执行请求时将发送的HTTP头的根元素。 报头应该使用与HTTP协议中相同的语法列出。
name x string 标题名称。
value x string 标题值。
follow_redirects - string 0 - NO
1 - YES (默认)
遵循HTTP重定向。
retrieve_mode - string 0 - BODY (默认)
1 - HEADERS
2 - BOTH
HTTP响应检索模式。
timeout - string 默认: 15s 步骤执行的超时时间。 秒,带有后缀或用户宏的时间单位。
required - string 必须在响应中出现的文本。 空值忽视。
status_codes - string 被接受的HTTP状态码的逗号分隔列表。 空值忽视。 例如: 200-201,210-299
tags - web场景标签的根元素。
tag x string 标签名
value - string 标签值。
Host web scenario steps
Element Type Description
name string (required) Web scenario step name.
url string (required) URL for monitoring.
query_fields Root element for query parameters (an array of HTTP fields to be added to the URL when performing a request).
name string (required) Query parameter name.
value string Query parameter value.
posts Root element for HTTP POST variables (a string (raw post data) or an array of HTTP fields (form field data)).
name string (required) Post field name.
value string (required) Post field value.
variables Root element of step-level variables (macros) that should be applied after this step.
If the variable value has a 'regex:' prefix, then its value is extracted from the data returned by this step according to the regular expression pattern following the 'regex:' prefix
name string (required) Variable name.
value text (required) Variable value.
headers Root element for HTTP headers to be sent when performing a request.
name string (required) Header name.
value text (required) Header value.
follow_redirects string Follow HTTP redirects.
Possible values:1 NO (0), YES (1, default).
retrieve_mode string HTTP response retrieve mode.
Possible values:1 BODY (0, default), HEADERS (1), BOTH (2).
timeout string Timeout (using seconds, time suffix, or user macro) of step execution.
Default: 15s.
required string Text that must be present in the response (ignored if empty).
status_codes string A comma-delimited list of accepted HTTP status codes (e.g., 200-201,210-299; ignored if empty).

See also: Web scenario step object (refer to the relevant property with a matching name).

附注

1 对于字符串值,只有字符串将被导出(例如"ZABBIX_ACTIVE"),而不使用该表中使用的编号。该表中的范围值(对应于API值)的编号仅用于排序。