2022 Zabbix中国峰会
2022 Zabbix中国峰会

> Host interface object主机接口对象

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

Host interface主机接口

The host interface object has the following properties. 56/5000 主机接口对象具有以下属性。

Note that both IP and DNS are required. If you do not want to use DNS, set it to an empty string.请注意,IP和DNS都是必需的。 如果您不想使用DNS,请将其设置为空字符串。

参数 类 描述
interfaceid string (readonly) ID of the interface.接口的ID。
dns
(required)
string DNS name used by the interface.接口使用的DNS名称。

Can be empty if the connection is made via IP.如果通过IP进行连接,则可以为空。
hostid
(required)
string ID of the host the interface belongs to. 接口所属主机的ID。
ip
(required)
string IP address used by the interface.接口使用的IP地址。

Can be empty if the connection is made via DNS. 如果通过DNS进行连接,可以为空。
main
(required)
integer Whether the interface is used as default on the host. Only one interface of some type can be set as default on a host.该接口是否在主机上用作默认接口。主机上只能有一种类型的接口作为默认设置。

Possible values are:可能的值是:
0 - not default; 不是默认值
1 - default.默认
port
(required)
string Port number used by the interface. Can contain user macros.接口使用的端口号。 可以包含用户宏。
type
(required)
integer Interface type. 接口类型

Possible values are: 可能的值是:
1 - agent;
2 - SNMP;
3 - IPMI;
4 - JMX.
useip
(required)
integer Whether the connection should be made via IP. 是否应通过IP进行连接。

Possible values are:可能的值是:
0 - connect using host DNS name; 连接使用主机DNS名称;
1 - connect using host IP address for this host interface.使用该主机接口的主机IP地址进行连接。
bulk integer Whether to use bulk SNMP requests.是否使用批量SNMP请求。

Possible values are: 可能的值是:
0 - don't use bulk requests; 不要使用批量请求;
1 - (default)默认 use bulk requests. 使用批量请求;