Zabbix Documentation 4.0

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools

This translation is older than the original page and might be outdated. See what has changed.

Sidebar

zh:manual:api:reference:discoveryrule:object

> LLD rule object LLD规则对象

> LLD 规则对象

The following objects are directly related to the discoveryrule API. 下面的对象直接关联到discoveryrule(发现规则) API。

LLD rule

LLD 规则

The low-level discovery rule object has the following properties. 低级发现规则对象有如下属性。

Property属性 Type类型 Description说明
itemid string (readonly) ID of the LLD rule. LLD规则的ID
delay
(required)
string Update interval of the LLD rule. 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.LLD规则更新间隔。接受s或者时间单位,有或没有一个或者多个的灵活间隔和固定计划间隔作为序列化字符串组成的custom intervals
hostid
(required)
string ID of the host that the LLD rule belongs to. LLD规则所属的Host的ID。
interfaceid
(required)
string ID of the LLD rule's host interface. Used only for host LLD rules. LLD规则所属的host的借口的ID

Optional for Zabbix agent (active), Zabbix internal, Zabbix trapper and database monitor LLD rules. Zabbix agent (active), Zabbix internal, Zabbix trapper and 数据库监控LLD规则的可选参数。
key_
(required)
string LLD rule key. LLD规则键。
name
(required)
string Name of the LLD rule. LLD规则名称。
type
(required)
integer Type of the LLD rule. LLD规则类型。

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);
10 - external check;
11 - database monitor;
12 - IPMI agent;
13 - SSH agent;
14 - TELNET agent;
16 - JMX agent;
19 - HTTP agent;
url
(required)
string URL string, required for HTTP agent LLD rule. Supports user macros, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}. URL字符串,HTTP agent LLD rule要求有。支持用户宏, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}。
allow_traps integer HTTP agent LLD rule field. Allow to populate value as in trapper item type also.HTTP agent LLD规则字段。在陷阱监控项类型中也允许填充值

0 - (default) Do not allow to accept incoming data.0 - (默认)不允许接受输入数据
1 - Allow to accept incoming data.1 - 允许输入数据
authtype integer Used only by SSH agent or HTTP agent LLD rules. 只能被SSH agent或HTTP agent使用

SSH agent authentication method possible values: SSH agent认证方法可能的值:
0 - (default) password;
1 - public key.

HTTP agent authentication method possible values:HTTP agent认证方法可能的值:
0 - (default) none
1 - basic
2 - NTLM
description string Description of the LLD rule. LLD规则说明。
error string (readonly) Error text if there are problems updating the LLD rule. 如果更新LLD规则出问题时的错误文本。
follow_redirects integer HTTP agent LLD rule field. Follow respose redirects while pooling data.HTTP agentLLD规则字段。当合并数据时进行重定向。

0 - Do not follow redirects.0 - 不跟随重定向。
1 - (default) Follow redirects. 1 - (default)跟随重定向。
headers object HTTP agent LLD rule field. Object with HTTP(S) request headers, where header name is used as key and header value as value. HTTP agent LLD规则字段。该对象带有HTTP(S)已键为名称,包头的值作为值的请求头。

Example:
{ “User-Agent”: “Zabbix” }
http_proxy string HTTP agent LLD rule field. HTTP(S) proxy connection string. HTTP agent LLD规则字段。HTTP(S) proxy连接字符串。
ipmi_sensor string IPMI sensor. Used only by IPMI LLD rules. IPMI sensor。只用于IPMILLD规则
jmx_endpoint string JMX agent custom connection string. JMX agent自定义连接字符串。

Default value: 默认值:
service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi
lifetime string Time period after which items that are no longer discovered will be deleted. Accepts seconds, time unit with suffix and user macro. 不在用于发现的item被删除的的时间周期。

Default: 30d.
output_format integer HTTP agent LLD rule field. Should response converted to JSON.HTTP agent LLD规则字段。应返回传递给JSON.

0 - (default) Store raw.
1 - Convert to JSON.
params string Additional parameters depending on the type of the LLD rule: 依赖于LLD规则类型的其他参数:
- executed script for SSH and Telnet LLD rules;- 为SSH何Telnet LLD规则执行脚本;
- SQL query for database monitor LLD rules;- 数据库监控LLD规则的SQL查询;
- formula for calculated LLD rules. - 计算类的LLD规则公式。
password string Password for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent LLD rules. 认证密码。用于simple check, SSH, Telnet, database monitor, JMX and HTTP agent LLD 规则。
port string Port used by the LLD rule. Used only by SNMP LLD rules. LLD规则使用的端口。仅SNMP LLD规则使用
post_type integer HTTP agent LLD rule field. Type of post data body stored in posts property.HTTP agent LLD 规则字段。post数据body部分存储在posts属性中的类型。

0 - (default) Raw data.
2 - JSON data.
3 - XML data.
posts string HTTP agent LLD rule field. HTTP(S) request body data. Used with post_type. HTTP agent LLD规则字段。HTTP(S)请求body数据,在post_type中使用。
privatekey string Name of the private key file.
publickey string Name of the public key file. 公共键文件的名称。
query_fields array HTTP agent LLD rule field. Query parameters. Array of objects with 'key':'value' pairs, where value can be empty string. HTTP agent LLD规则字段。查询参数。带有'key':'value' 键值对的数组对象,值可以为空。
request_method integer HTTP agent LLD rule field. Type of request method. HTTP agent LLD规则字段。请求方法类型。

0 - GET
1 - (default) POST
2 - PUT
3 - HEAD
retrieve_mode integer HTTP agent LLD rule field. What part of response should be stored. HTTP agent LLD规则字段。指明哪部分响应应被存储起来。

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

For request_method HEAD only 1 is allowed value.
snmp_community string SNMP community.

Required for SNMPv1 and SNMPv2 LLD rules.
snmp_oid string SNMP OID.
snmpv3_authpassphrase string SNMPv3 auth passphrase. Used only by SNMPv3 LLD rules. SNMPv3认证密码。仅在SNMPv3 LLD规则中使用。
snmpv3_authprotocol integer SNMPv3 authentication protocol. Used only by SNMPv3 LLD rules. SNMPv3认证协议。仅在SNMPv3 LLD规则中使用。

Possible values:
0 - (default) MD5;
1 - SHA.
snmpv3_contextname string SNMPv3 context name. Used only by SNMPv3 checks. SNMPv3文本名称。仅在SNMPv3检查中使用。
snmpv3_privpassphrase string SNMPv3 priv passphrase. Used only by SNMPv3 LLD rules. SNMPv3秘钥。仅在SNMPv3 LLD规则使用。
snmpv3_privprotocol integer SNMPv3 privacy protocol. Used only by SNMPv3 LLD rules. SNMPv3私密协议。仅在SNMPv3 LLD规则使用。

Possible values:
0 - (default) DES;
1 - AES.
snmpv3_securitylevel integer SNMPv3 security level. Used only by SNMPv3 LLD rules. SNMPv3安全等级。仅在SNMPv3 LLD规则使用。

Possible values:
0 - noAuthNoPriv;
1 - authNoPriv;
2 - authPriv.
snmpv3_securityname string SNMPv3 security name. Used only by SNMPv3 LLD rules. SNMPv3安全名称。仅在SNMPv3 LLD规则使用。
ssl_cert_file string HTTP agent LLD rule field. Public SSL Key file path. HTTP agent LLD规则字段。公共SSL键文件路径。
ssl_key_file string HTTP agent LLD rule field. Private SSL Key file path. HTTP agent LLD规则字段。私有SSL键文件路径。
ssl_key_password string HTTP agent LLD rule field. Password for SSL Key file. HTTP agent LLD规则字段。SSL键文件密码。
state integer (readonly) State of the LLD rule.

Possible values:
0 - (default) normal;
1 - not supported.
status integer Status of the LLD rule.

Possible values:
0 - (default) enabled LLD rule;
1 - disabled LLD rule.
status_codes string HTTP agent LLD rule field. Ranges of required HTTP status codes separated by commas. Also supports user macros as part of comma separated list. HTTP agent LLD规则字段。以逗号分隔的HTTP要求的状态码范围。

Example: 200,200-{$M},{$M},200-400
templateid string (readonly) ID of the parent template LLD rule. (只读)父模板LLD规则的ID。
timeout string HTTP agent LLD rule field. Item data polling request timeout. Support user macros. HTTP agent LLD规则字段。Item数据轮训请求超时时间。知识用户宏。

default: 3s
maximum value: 60s
trapper_hosts string Allowed hosts. Used by trapper LLD rules or HTTP agent LLD rules. 允许的主机。用于trapper LLD规则或HTTP agent LLD规则。
username string Username for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent LLD rules. 认证的用户名。用于simple check, SSH, Telnet, database monitor, JMX and HTTP agent LLD 规则

Required by SSH and Telnet LLD rules. SSH 和 Telnet LLD 规则要求。
verify_host integer HTTP agent LLD rule field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate. HTTP agent LLD规则字段。URL中的主机名处于通用名称字段或主机证书的主题备用名称字段的合法性。

0 - (default) Do not validate.
1 - Validate.
verify_peer integer HTTP agent LLD rule field. Validate is host certificate authentic. HTTP agent LLD规则字段。主机认证证书合法性。

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

LLD rule filter

LLD 规则 过滤器

The LLD rule filter object defines a set of conditions that can be used to filter discovered objects. It has the following properties: LLD规则筛选器对象定义一套能被用于过滤器发现对象的条件。它包含如下属性:

Property Type Description
conditions
(required)
array Set of filter conditions to use for filtering results.
evaltype
(required)
integer Filter condition evaluation method.

Possible values:
0 - and/or;
1 - and;
2 - or;
3 - custom expression.
eval_formula string (readonly) Generated expression that will be used for evaluating filter conditions. The expression contains IDs that reference specific filter conditions by its formulaid. The value of eval_formula is equal to the value of formula for filters with a custom expression. 生成的表达式将用于评估过滤器条件。表达式包含通过其“ormulaid”引用特定筛选条件的ID。eval_formula 的值与formula 的值相等
formula string User-defined expression to be used for evaluating conditions of filters with a custom expression. The expression must contain IDs that reference specific filter conditions by its formulaid. The IDs used in the expression must exactly match the ones defined in the filter conditions: no condition can remain unused or omitted. 用户定义表达式,用于评估具有自定义表达式的筛选器的条件。表达式必须包含通过其“公式辅助”引用特定筛选条件的ID。表达式中使用的ID必须与筛选条件中定义的ID完全匹配:没有条件可以保持未使用或省略。

Required for custom expression filters.

LLD rule filter condition

LLD rule 过滤器条件

The LLD rule filter condition object defines a separate check to perform on the value of an LLD macro. It has the following properties: LLD规则过滤器条件对象定义对LLD宏的值执行的单独检查:

Property Type Description
macro
(required)
string LLD macro to perform the check on.
value
(required)
string Value to compare with.
formulaid string Arbitrary unique ID that is used to reference the condition from a 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. 用于从自定义表达式引用条件的任意唯一ID。只能包含大写字母。在修改过滤条件时,ID必须由用户定义,但在请求之后,将重新生成ID。
operator integer Condition operator.

Possible values:
8 - (default) matches regular expression;
9 - does not match regular expression.
To better understand how to use filters with various types of expressions, see examples on the discoveryrule.get and discoveryrule.create method pages.