需求:
nms只能读取设备指定物理接口的流速 或此物理接口的所有信息,使用snmp v2c
其他信息不能读取
结论:
没办法通过一个配置做到“允许读某接口所有信息”,只能“允许读某接口流量、索引、错包”这类具体的需求。
举例,按照下面配置定义mib-view test,给community授权mib-view,之后定义mib-view所包含的节点。
snmp-agent community read abc mib-view test
snmp-agent mib-view excluded test iso //阻断所有节点
snmp-agent mib-view included test ifHCInOctets.387 //放通特定节点
snmp-agent mib-view included test ifHCInOctets.17665
效果如下:
不做权限限制时,读ifHCInOctets节点能读到所有接口数据,
***** SNMP QUERY STARTED *****
1: ifHCInOctets.385 (counter64) 0
2: ifHCInOctets.386 (counter64) 0
3: ifHCInOctets.387 (counter64) 5462782
4: ifHCInOctets.388 (counter64) 0
……
46: ifHCInOctets.602 (counter64) 0
47: ifHCInOctets.17665 (counter64) 1525751
48: ifHCInOctets.17793 (counter64) 0
49: ifHCInOctets.17794 (counter64) 0
50: ifHCInOctets.17985 (counter64) 0
51: ifHCInOctets.17986 (counter64) 0
***** SNMP QUERY FINISHED *****
限制权限后,仅能读到387和17665两个接口的数据。
***** SNMP QUERY STARTED *****
1: ifHCInOctets.387 (counter64) 5494558
2: ifHCInOctets.17665 (counter64) 1533823
***** SNMP QUERY FINISHED *****
此时再去读ifHCInUcastPkts节点,由于mib-view没有放通,读不到任何结果。如果需要读387等接口ifHCInUcastPkts,需要再snmp-agent mib-view included test ifHCInUcastPkts.387
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作