主要利用snmpget函数根据index值获取相关端口信息,如下:
1.端口描述
snmpget('ipAddress', 'community_name', 'IF-MIB::ifDescr.index值')
2.端口名称
snmpget('ipAddress', 'community_name', 'IF-MIB::ifName.index值')
...
主要便是拼第三个串:
ifIndex 端口索引号
ifDescr 端口描述
ifType 端口类型
ifMtu 最大传输包字节数
ifSpeed 端口速度
ifPhysAddress 物理地址
ifOperStatus 操作状态
ifLastChange 上次状态更新时间
状态信息有两种:AdminStatus 和OperStatus
主要参考文章:https://blog.csdn.net/ysdaniel/article/details/37927541