Mib Brower can pick up and display details when I use command line trap
However, when I trap using SNMP4J, Mib Brower does not show details. Are they incompatible?Or is there something wrong with my trap code?
public void test () throws IOException {
TransportMapping transport = new DefaultUdpTransportMapping();
transport.listen();
CommunityTarget cTarget = new CommunityTarget();
cTarget.setCommunity(new OctetString("public"));
cTarget.setVersion(SnmpConstants.version2c);
cTarget.setAddress(new UdpAddress("192.168.**.***" + "/" + 162));
cTarget.setRetries(2);
cTarget.setTimeout(5000);
PDU pdu = new PDU();
pdu.add(new VariableBinding(SnmpConstants.sysUpTime,new OctetString(new Date().toString())));
pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID("1.3.6.1.4.1.48183")));
pdu.add(new VariableBinding(SnmpConstants.snmpTrapAddress, new IpAddress("172.24.8.132")));
pdu.add(new VariableBinding(new OID("1.3.6.1.4.1.48183.1"), new OctetString("Major")));
pdu.setType(PDU.NOTIFICATION);
Snmp snmp = new Snmp(transport);
System.out.println("Sending V2 Trap... Check Wheather NMS is Listening or not? ");
snmp.send(pdu, cTarget);
snmp.close();
Using this code can receive information on the command line, but mib Brower cannot display it