SNMP OID格式为:
discovery[{#MACRO1}, oid1, {#MACRO2}, oid2, …,]
以发现接口信息为例:
discovery[{#IFDESCR},1.3.6.1.2.1.2.2.1.2,
{#IFNAME},1.3.6.1.2.1.31.1.1.1.1,
{#IFALIAS},1.3.6.1.2.1.31.1.1.1.18,
{#IFTYPE},1.3.6.1.2.1.2.2.1.3,
{#IFOPERSTATUS},1.3.6.1.2.1.2.2.1.8]
返回的数据格式为:
{
"data": [
{
"{#SNMPINDEX}": "1",
"{#IFDESCR}": "Ten-GigabitEthernet0/0/1",
"{#IFALIAS}": ""
"{#IFTYPE}": "6"
"{#IFOPERSTATUS}": "1"
},
{
"{#SNMPINDEX}": "1",
"{#IFDESCR}": "Ten-GigabitEthernet0/0/2",
"{#IFALIAS}": ""
"{#IFTYPE}": "6"
"{#IFOPERSTATUS}": "1"
},
{
"{#SNMPINDEX}": "3",
"{#IFDESCR}": "Ten-GigabitEthernet0/0/1",
"{#IFALIAS}": ""
"{#IFTYPE}": "6"
"{#IFOPERSTATUS}": "1"
}
]
}
SNMP Community填写设备配置的读团体字
配置监控原型(以接口入方向流量大小为例):
名称设置为:
Interface {#IFDESCR} {#IFALIAS} ifInOctets
键值:
network.if.ifInOctets[{#IFDESCR} ]
SNMP OID:
1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}
官方文档:
https://www.zabbix.com/documentation/4.0/manual/discovery/low_level_discovery/snmp_oids