IOS-XE 上的 SNMPv3 上下文似乎不适用于 Prime

网络工程 思科-ios snmp cisco-ios-15 ios-xe smpv3
2021-07-17 13:38:25

我们最近切换到 SNMPV3 并遇到问题,prime 中不再有可用的客户端数据。因此,我们快速阅读了我们需要添加到设备配置中的 SNMP 上下文,以便prime 获取正确的数据。这适用于 IOS。但是到目前为止,我们对 IOS-XE 没有任何运气。这是适用于我们 2960X 型号的配置:

snmp-server group COMPANY v3 priv context vlan- match prefix read COMPANY

当我们发出 show snmp group 和 context 时,我们得到:

switch#show snmp group 
groupname: COMPANY                          security model:v3 priv 
contextname: <no context specified>         storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-                          storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

switch#show snmp context 
vlan-1
vlan-10
vlan-11
vlan-20

因此,如果我们检查 IOS-XE 的配置,它看起来是一样的,但它根本不起作用。没有客户端连接到任何可见的 IOS-XE 设备。我们有不同型号的交换机,例如:Cisco Catalyst 3850 和 9200。我们尝试使用每个 Vlan 的上下文,但这也无济于事:

snmp-server group COMPANY v3 priv context vlan-1 read COMPANY 
snmp-server group COMPANY v3 priv context vlan-10 read COMPANY 
snmp-server group COMPANY v3 priv context vlan-11 read COMPANY 
snmp-server group COMPANY v3 priv context vlan-20 read COMPANY 

switch#show snmp group                   
groupname: COMPANY                          security model:v3 priv 
contextname: <no context specified>         storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-1                         storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-10                        storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-11                        storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-20                        storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

switch#show snmp context 
vlan-1
vlan-10
vlan-11
vlan-20

我尝试使用默认的 readview,因为我看到一些配置使用 v1default:

snmp-server group COMPANY v3 priv read COMPANY
snmp-server group COMPANY v3 priv context vlan- match prefix 

switch#show snmp group 
groupname: COMPANY                          security model:v3 priv 
contextname: <no context specified>         storage-type: nonvolatile
readview : COMPANY                          writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

groupname: COMPANY                          security model:v3 priv 
contextname: vlan-                          storage-type: nonvolatile
readview : v1default                        writeview: <no writeview specified>        
notifyview: <no notifyview specified>       
row status: active

到目前为止没有任何帮助。我在网上找不到任何有同样问题的人,所以这就是我把它放在这里的原因。如果有人可以提供 prime 使用的正确字符串 (OID),我可能可以使用 SNMP 客户端对此进行测试,以查看两个操作系统之间的响应是否不同。

1个回答

我找到了解决方法。诀窍是不要将阅读社区置于命令中。所以我们将它部署到所有 IOS 和 IOS-XE 交换机,它适用于所有 Vlan:

snmp-server group COMPANY v3 priv context vlan- match prefix

prime 中也存在一个奇怪的计时问题,这使得验证配置变得困难。