> Item object 监控项对象

The following objects are directly related to the item API. 以下对象与 “item” API直接相关。

Item

监控项

Web items cannot be directly created, updated or deleted via the Zabbix API.

Web 监控项无法通过 Zabbix API 直接创建,更新或删除。

The item object has the following properties. 监控项对象具有以下属性。

Property 属性 Tpe 类型 Desription 说明
itemidstring(readonly) ID of the item. 监控项ID。
delay
(required)
stringUpdate interval of the item. Accepts seconds or time unit with suffix and with or without one or more custom intervals that consist of either flexible intervals and scheduling intervals as serialized strings. Also accepts user macros. Flexible intervals could be written as two macros separated by a forward slash. Intervals are separated by a semicolon. 更新监控项的时间间隔。 接受具有后缀的秒或时间单位,并且具有或不具有由灵活间隔和调度间隔组成的一个或多个自定义间隔作为串行化字符串。也接受用户宏。 灵活的间隔可以写成两个由正斜杠分隔的宏。 间隔用分号分隔。

Optional for Zabbix trapper or Dependent item.
hostid
(required)
stringID of the host that the item belongs to. 该监控项所属的主机 ID。

For update operations this field is readonly.
interfaceid
(required)
stringID of the item’s host interface. Used only for host items. 监控项主机接口的ID。 仅用于主机项。

Optional for Zabbix agent (active), Zabbix internal, Zabbix trapper, Dependent item, Zabbix aggregate, database monitor and calculated items. 适用于Zabbix代理(活动),Zabbix内部,Zabbix陷阱,依赖项,Zabbix聚合,数据库监控和计算项
key_
(required)
stringItem key.
name
(required)
stringName of the item.
type
(required)
integerType of the item.

Possible values:
0 - Zabbix agent;
1 - SNMPv1 agent;
2 - Zabbix trapper;
3 - simple check;
4 - SNMPv2 agent;
5 - Zabbix internal;
6 - SNMPv3 agent;
7 - Zabbix agent (active);
8 - Zabbix aggregate;
9 - web item;
10 - external check;
11 - database monitor;
12 - IPMI agent;
13 - SSH agent;
14 - TELNET agent;
15 - calculated;
16 - JMX agent;
17 - SNMP trap;
18 - Dependent item;
19 - HTTP agent;
url
(required)
stringURL string, required only for HTTP agent item type. Supports user macros, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}. URL字符串,仅HTTP agent监控项类型需要。支持用户宏,{HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST},{HOST.NAME}, {ITEM.ID}, {ITEM.KEY}。
value_type
(required)
integerType of information of the item. 监控项信息的类型。

Possible values:
0 - numeric float;
1 - character;
2 - log;
3 - numeric unsigned;
4 - text.
allow_trapsintegerHTTP agent item field. Allow to populate value as in trapper item type also. HTTP agent监控项字段。允许和trapper监控项一样的填充值。

0 - (default) Do not allow to accept incoming data.
1 - Allow to accept incoming data.
authtypeintegerUsed only by SSH agent items or HTTP agent items. 仅在SSH agent items or HTTP agent items中使用。

SSH agent authentication method possible values:
0 - (default) password;
1 - public key.

HTTP agent authentication method possible values:
0 - (default) none
1 - basic
2 - NTLM
descriptionstringDescription of the item. 监控项说明。
errorstring(readonly) Error text if there are problems updating the item. 当更新监控项出错时的错误文本。
flagsinteger(readonly) Origin of the item.

Possible values:
0 - a plain item;
4 - a discovered item.
follow_redirectsintegerHTTP agent item field. Follow respose redirects while pooling data. HTTP agent 监控项字段。合并数据时跟随重定向。

0 - Do not follow redirects.
1 - (default) Follow redirects.
headersobjectHTTP agent item field. Object with HTTP(S) request headers, where header name is used as key and header value as value. HTTP agent 监控项字段。带有HTTP(S)请求报头的对象,报头名为键名,报头值为值。

Example:
{ “User-Agent”: “Zabbix” }
historystringA time unit of how long the history data should be stored. Also accepts user macro. 一个历史数据被保存的时长的时间单位。接受用户宏。

Default: 90d.
http_proxystringHTTP agent item field. HTTP(S) proxy connection string. HTTP agent 监控项字段。HTTP(S)代理连接字符串。
inventory_linkintegerID of the host inventory field that is populated by the item. 监控项填充的主机资产的ID。

Refer to the host inventory page for a list of supported host inventory fields and their IDs.

Default: 0.
ipmi_sensorstringIPMI sensor. Used only by IPMI items. IPMI传感器。仅用于IPMI监控项。
jmx_endpointstringJMX agent custom connection string. JMX agent自定义的连接字符串。

Default value:
service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi
lastclocktimestamp(readonly) Time when the item was last updated. 监控项最后被更新的时间。

This property will only return a value for the period configured in ZBX_HISTORY_PERIOD.
lastnsinteger(readonly) Nanoseconds when the item was last updated. 监控项最后被更新的纳秒。

This property will only return a value for the period configured in ZBX_HISTORY_PERIOD.
lastvaluestring(readonly) Last value of the item. 监控项最新的值。

This property will only return a value for the period configured in ZBX_HISTORY_PERIOD.
logtimefmtstringFormat of the time in log entries. Used only by log items. 日志条目的时间格式。仅用于日志监控项。
master_itemidintegerMaster item ID.
Recursion up to 3 dependent items and maximum count of dependent items equal to 999 are allowed. 允许多达3个依赖监控项的递归和监控项的最大计数等于999

Required by Dependent items.
mtimetimestampTime when the monitored log file was last updated. Used only by log items. 被监控的日志文件最后一次被更新的时间。仅泳衣日志监控项。
output_formatintegerHTTP agent item field. Should response converted to JSON. HTTP agent监控项字段。返回数据应被转换成JSON。

0 - (default) Store raw.
1 - Convert to JSON.
paramsstringAdditional parameters depending on the type of the item: 取决于监控项类型的附加参数:
- executed script for SSH and Telnet items;
- SQL query for database monitor items;
- formula for calculated items.
passwordstringPassword for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent items. 认证的密码。用于simple check, SSH, Telnet, database monitor, JMX and HTTP agent items.
When used by JMX, username should also be specified together with password or both properties should be left blank. 当贝JMX使用时,用户名应和密码一起提供,或者同时留空。
portstringPort monitored by the item. Used only by SNMP items. 监控项监控的端口。仅用于SMNP监控项。
post_typeintegerHTTP agent item field. Type of post data body stored in posts property. HTTP agent字段。存储在post属性的post的数据类型。

0 - (default) Raw data.
2 - JSON data.
3 - XML data.
postsstringHTTP agent item field. HTTP(S) request body data. Used with post_type. HTTP agent字段。HTTP(S)请求报文。仅用于post_type。
prevvaluestring(readonly) Previous value of the item. 监控项的前一个值。

This property will only return a value for the period configured in ZBX_HISTORY_PERIOD.
privatekeystringName of the private key file. 私钥文件名。
publickeystringName of the public key file. 公钥的文件名。
query_fieldsarrayHTTP agent item field. Query parameters. Array of objects with ‘key’:’value’ pairs, where value can be empty string. HTTP agent监控项字段。查询参数。带有键值对的数组对象,值可为空。
request_methodintegerHTTP agent item field. Type of request method. HTTP agent监控项字段。请求方法的类型。

0 - GET
1 - (default) POST
2 - PUT
3 - HEAD
retrieve_modeintegerHTTP agent item field. What part of response should be stored. HTTP agent监控项字段。被存储的响应的部分。

0 - (default) Body.
1 - Headers.
2 - Both body and headers will be stored.

For request_method HEAD only 1 is allowed value.
snmp_communitystringSNMP community. Used only by SNMPv1 and SNMPv2 items. SNMP community。仅用于SNMPv1 and SNMPv2 监控项。
snmp_oidstringSNMP OID.
snmpv3_authpassphrasestringSNMPv3 auth passphrase. Used only by SNMPv3 items. SNMPv3认证密码。仅用于SNMPv3监控项。
snmpv3_authprotocolintegerSNMPv3 authentication protocol. Used only by SNMPv3 items. SNMPv3认证协议。仅用于SNMPv3监控项。

Possible values:
0 - (default) MD5;
1 - SHA.
snmpv3_contextnamestringSNMPv3 context name. Used only by SNMPv3 items. SNMPv3文本名称。仅用于SNMPv3监控项。
snmpv3_privpassphrasestringSNMPv3 priv passphrase. Used only by SNMPv3 items. SNMPv3私钥。仅用于SNMPv3监控项。
snmpv3_privprotocolintegerSNMPv3 privacy protocol. Used only by SNMPv3 items. SNMPv3文私密协议。仅用于SNMPv3监控项。

Possible values:
0 - (default) DES;
1 - AES.
snmpv3_securitylevelintegerSNMPv3 security level. Used only by SNMPv3 items. SNMPv3安全等级。仅用于SNMPv3监控项。

Possible values:
0 - noAuthNoPriv;
1 - authNoPriv;
2 - authPriv.
snmpv3_securitynamestringSNMPv3 security name. Used only by SNMPv3 items. SNMPv3安全名称。仅用于SNMPv3监控项。
ssl_cert_filestringHTTP agent item field. Public SSL Key file path. HTTP agent监控项字段。公共SSL 秘钥的文件路径。
ssl_key_filestringHTTP agent item field. Private SSL Key file path. HTTP agent监控项字段。私有SLL秘钥的文件路径。
ssl_key_passwordstringHTTP agent item field. Password for SSL Key file. HTTP agent监控项字段。SSL 秘钥的文件密码。
stateinteger(readonly) State of the item.

Possible values:
0 - (default) normal;
1 - not supported.
statusintegerStatus of the item.

Possible values:
0 - (default) enabled item;
1 - disabled item.
status_codesstringHTTP agent item field. Ranges of required HTTP status codes separated by commas. Also supports user macros as part of comma separated list. HTTP agent监控项字段。以逗号分隔的HTTP 状态码的范围。也支持作为逗号分隔的用户宏列表。

Example: 200,200-{$M},{$M},200-400
templateidstring(readonly) ID of the parent template item. (只读)父模板的ID。
timeoutstringHTTP agent item field. Item data polling request timeout. Support user macros. HTTP agent监控项字段。监控项数据轮询超时时间。支持用户宏。

default: 3s
maximum value: 60s
trapper_hostsstringAllowed hosts. Used by trapper items or HTTP agent items. 接受的主机。仅用于trapper监控项或者HTTP agent监控项。
trendsstringA time unit of how long the trends data should be stored. Also accepts user macro. 时间单位,数据数据被保存的时间长度。也接受用户宏。

Default: 365d.
unitsstringValue units. 值的单位。
usernamestringUsername for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent items. 认证的用户名。用于simple check, SSH, Telnet, database monitor, JMX and HTTP agent 监控项。

Required by SSH and Telnet items. SSH and Telnet items 要求提供。
When used by JMX, password should also be specified together with username or both properties should be left blank. 当被JMX使用时,密码也要和用户名一起被提供或者一起留空。
valuemapidstringID of the associated value map. 关联映射值的ID。
verify_hostintegerHTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. HTTP agent字段。验证URL中的主机名处于通用名称字段或主机证书的主题备用名称字段

0 - (default) Do not validate.
1 - Validate.
verify_peerintegerHTTP agent item field. Validate is host certificate authentic. HTTP agent字段。验证主机的合法性。

0 - (default) Do not validate.
1 - Validate.

Item preprocessing 监控项预处理

The item preprocessing object has the following properties. 监控项预处理对象有如下属性。

PropertyTypeDescription
type
(required)
integerThe preprocessing option type.

Possible values:
1 - Custom multiplier;
2 - Right trim;
3 - Left trim;
4 - Trim;
5 - Regular expression matching;
6 - Boolean to decimal;
7 - Octal to decimal;
8 - Hexadecimal to decimal;
9 - Simple change;
10 - Change per second.
params
(required)
stringAdditional parameters used by preprocessing option. Multiple parameters are separated by LF (\n) character.