如何从 SNMP MIB 获取 ifOperStatus?

How to get ifOperStatus from the SNMP MIB?

我试图用 snmpget 得到 ifOperStatus,但我发现 here 他是这样做的

snmpwalk -Os -c public -v 1 192.168.1.1 1.3.6.1.2.1.2.2.1.8

所以我试过了,但没有结果

但是 SNMP 代理正在工作。

谁能告诉我如何访问 ifOperStatus?

假设你的snmpwalk是NET-SNMP版本,那么

snmpwalk -Os -c public -v 1 192.168.1.1 .1.3.6.1.2.1.2.2.1.8

应该有效(注意 OID 前面的额外点)。 这使它成为一个绝对的 OID,而不是相对的。