Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个我在网上找了好久,才发现可以用snmp trap来实现这个功能,但是不知道snmp++中trap怎么用,只能找到怎么用在net-snmp中使用trap,但是我们的老师要求我们使用snmp++。所以如果有人可以帮助我,我将非常感谢
首先,您需要知道,为了启用/禁用端口,您必须切换IF-MIB 中定义的ifAdminStatus 。
接口向上:
snmpset -v1 -c community hostname IF-MIB::ifAdminStatus.interface i 1
接口关闭:
snmpset -v1 -c community hostname IF-MIB::ifAdminStatus.interface i 2
有一组很好的示例,包括SNMP++ 库附带的snmpset 。因此,您应该能够相应地修改此示例应用程序以实现您所需要的。