snmpwalk-MIB of S5700-idc-stack
IF-MIB:.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifDescr
OID:.1.3.6.1.2.1.2.2.1.2
针对普通网络设备的端口,MIB的相关定义是Interface组,主要管理如下信息:
ifIndex 端口索引号
ifDescr 端口描述
ifType 端口类型
ifMtu 最大传输包字节数
ifSpeed 端口速度
ifPhysAddress 物理地址
ifOperStatus 操作状态
ifLastChange 上次状态更新时间
*ifInOctets 输入字节数
*ifInUcastPkts 输入非广播包数
*ifInNUcastPkts 输入广播包数
*ifInDiscards 输入包丢弃数
*ifInErrors 输入包错误数
*ifInUnknownProtos 输入未知协议包数
*ifOutOctets 输出字节数
*ifOutUcastPkts 输出非广播包数
*ifOutNUcastPkts 输出广播包数
*ifOutDiscards 输出包丢弃数
*ifOutErrors 输出包错误数
ifOutQLen 输出队长
其中,*号标识的是与网络流量有关的信息。
snmpwalk -c Niot2017 -v 2c 172.16.17.3
SNMPv2-MIB::sysDescr.0 = STRING: S5700-24TP-SI-AC Huawei Versatile Routing Platform Software
VRP (R) software,Version 5.130 (S5700 V200R003C00SPC300) Copyright (C) 2007 Huawei Technologies Co., Ltd.
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2011.2.23.145
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (890246420) 103 days, 0:54:24.20
SNMPv2-MIB::sysContact.0 = STRING: R&D Beijing, Huawei Technologies co.,Ltd.
SNMPv2-MIB::sysName.0 = STRING: IDC-S5700-iStack
SNMPv2-MIB::sysLocation.0 = STRING: Beijing China
SNMPv2-MIB::sysServices.0 = INTEGER: 78
$ snmpwalk -c Niot2017 -v 2c 172.16.17.3 IF-MIB::interfaces
IF-MIB::ifNumber.0 = INTEGER: 65
IF-MIB::ifIndex.1 = INTEGER: 1
……
IF-MIB::ifIndex.3 = INTEGER: 65
IF-MIB::ifDescr.1 = STRING: InLoopBack0
IF-MIB::ifDescr.2 = STRING: NULL0
IF-MIB::ifDescr.3 = STRING: Console9/0/0
IF-MIB::ifDescr.4 = STRING: MEth0/0/1
IF-MIB::ifDescr.5 = STRING: Vlanif1
IF-MIB::ifDescr.6 = STRING: GigabitEthernet0/0/1
……
IF-MIB::ifDescr.6 = STRING: GigabitEthernet0/0/65
……
IF-MIB::ifType.6 = INTEGER: ethernetCsmacd(6)
……
IF-MIB::ifAdminStatus.6 = INTEGER: up(1)
……
IF-MIB::ifOperStatus.6 = INTEGER: up(1) 真实接口状态
……
IF-MIB::ifInOctets.24 = Counter32: 3050874002
……
IF-MIB::ifInUcastPkts.24 = Counter32: 829238967
……
IF-MIB::ifInNUcastPkts.24 = Counter32: 0
……
IF-MIB::ifOutOctets.24 = Counter32: 1233577471
……
$ snmpget -c Niot2017 -v 2c 172.16.17.3 IF-MIB::ifDescr.24 IF-MIB::ifOperStatus.24 IF-MIB::ifInOctets.24 IF-MIB::ifOutOctets.24
IF-MIB::ifDescr.24 = STRING: GigabitEthernet0/0/19
IF-MIB::ifOperStatus.24 = INTEGER: up(1)
IF-MIB::ifInOctets.24 = Counter32: 3270781354
IF-MIB::ifOutOctets.24 = Counter32: 1401465661
$ snmpget -c Niot2017 -v 2c 172.16.17.3 .1.3.6.1.2.1.2.2.1.2.24 .1.3.6.1.2.1.2.2.1.8.24 .1.3.6.1.2.1.2.2.1.10.24 .1.3.6.1.2.1.2.2.1.16.24
IF-MIB::ifDescr.24 = STRING: GigabitEthernet0/0/19
IF-MIB::ifOperStatus.24 = INTEGER: up(1)
IF-MIB::ifInOctets.24 = Counter32: 3282340609
IF-MIB::ifOutOctets.24 = Counter32: 1415794870
snmpget -c Niot2017 -v 2c 172.16.17.3 .iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifDescr.24
IF-MIB::ifDescr.24 = STRING: GigabitEthernet0/0/19
在MIB-2功能组的接口组中,如果对象ifAdminStatus的值为up(1) ,而ifOperStatus的值down(2) ,则该接口处于故障状态。如果对象if_AdminStatus、ifOperStatus的值均为up(1) ,则接口处于正常状态;如果对象ifAdminStatus、ifOperStatus的值均为down(2) ,则接口处于停机状态;如果对象ifAdminStatus、ifOperStatus的值均为Testing(3) ,则接口处于测试状态。