[SNMP4J] Question on sending v2c trap

Andrew Chan wingnin at gmail.com
Thu Sep 22 22:12:22 CEST 2005


Dear all,
  I can send v1 trap from my program, the pdu were created as follow
  PDUv1 pdu = new PDUv1();
pdu.setType(PDU.V1TRAP);
pdu.setGenericTrap(PDUv1.ENTERPRISE_SPECIFIC);
 pdu.setSpecificTrap(4);
pdu.add(new VariableBinding(new OID(MYOID + ".1"), new Integer32(1)));
  When I try to migrate the code to v2c, how should I create the PDU?
  PDU pdu = new PDU();
pdu.setType(PDU.TRAP);
pdu.add(new VariableBinding(SnmpConstants.snmpTrapEnterprise, new OID(MYOID
+ "0.4"));
pdu.add(new VariableBinding(new OID(MYOID + ".1"), new Integer32(1)));
 However, I capture a invalid notification format error from some MIB
Browser (from MG-Soft), can you help me to solve this problem? Thanks.
 AC



More information about the SNMP4J mailing list