私人mib的定义如下:
1.3.6.1.4.1.49763.1.2.5
userTrap NOTIFICATION-TYPE
OBJECTS{
userName,
userType,
userStatus
}
STATUS current
DESCRIPTION
"Traps of user operation"
::={stationTrap 2}
我的代码受SNMP4J支持,如下所示
public void processPdu(CommandResponderEvent CREvent) {
if (CREvent != null && CREvent.getPDU() != null) {
try {
Vector<? extends VariableBinding> recVBs =
CREvent.getPDU().getVariableBindings();
for (int i = 0; i < recVBs.size(); i++) {
VariableBinding recVB = recVBs.elementAt(i);
System.out.println(recVB.getOid() + " : " +
recVB.getVariable());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
我想知道这个陷阱的响应类型是什么,如何在OBJECTS中获取userName和userType