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

> 主机接口对象

以下对象与hostinterfaceAPI直接相关.

主机接口

主机接口对象具有以下属性.

请注意,IP和DNS都是必需的。 如果您不想使用DNS,请将其设置为空字符串.

属性 类 描述
interfaceid 字符串 *( 读)* 接口ID.
dns
(必选)
字符 接
使用的DNS名称.
如果通过IP连接,可以设置为空.
hostid
(必选)
字符 接 归属的主机ID.
ip
(必选)
字符 接
使用的IP地址.
如果通过DNS域名连接,可以设置为空.
main
(必选)
整数 该
口是否在主机上用作默认接口. 主机上只能有一种类型的接口作为默认设置.
可能的值:
0 - 不是默认;
1 - 默认.
port
(必选)
字符 接 使用的端口号,可以包含用户宏.
type
(必选)
整数 接
类型.
可能的值:
1 - agent;
2 - SNMP;
3 - IPMI;
4 - JMX.
useip
(必选)
整数 是
应通过IP进行连接.
可能的值:
0 - 使用主机DNS名称连接;
1 - 使用该主机接口的主机IP地址进行连接.
bulk 整数 是 使用批量SNMP请求.

可能的值:
0 - 不要使用批量请求;
1 - (默认) 使用批量请求.

Details tag

The details object has the following properties.

Property Type Description
version
(required)
integer SNMP interface version.

Possible values are:
1 - SNMPv1;
2 - SNMPv2c;
3 - SNMPv3
bulk integer Whether to use bulk SNMP requests.

Possible values are:
0 - don't use bulk requests;
1 - (default) - use bulk requests.
community string SNMP community (required). Used only by SNMPv1 and SNMPv2 interfaces.
securityname string SNMPv3 security name. Used only by SNMPv3 interfaces.
securitylevel integer SNMPv3 security level. Used only by SNMPv3 interfaces.

Possible values are:
0 - (default) - noAuthNoPriv;
1 - authNoPriv;
2 - authPriv.
authpassphrase string SNMPv3 authentication passphrase. Used only by SNMPv3 interfaces.
privpassphrase string SNMPv3 privacy passphrase. Used only by SNMPv3 interfaces.
authprotocol integer SNMPv3 authentication protocol. Used only by SNMPv3 interfaces.

Possible values are:
0 - (default) - MD5;
1 - SHA1;
2 - SHA224;
3 - SHA256;
4 - SHA384;
5 - SHA512.
privprotocol integer SNMPv3 privacy protocol. Used only by SNMPv3 interfaces.

Possible values are:
0 - (default) - DES;
1 - AES128;
2 - AES192;
3 - AES256;
4 - AES192C;
5 - AES256C.
contextname string SNMPv3 context name. Used only by SNMPv3 interfaces.