[SNMP4J] Question regarding SNMPv2c Notification using SNMP4J

Vinod Kumar vinodkumar123 at gmail.com
Sat Jan 7 08:54:48 CET 2006


Hello,

You could do a small help to me.
I was sending a SNMP v2c notification using SNMP4J. But I am surprised to
see there is nowhere I need to specify the OID of the notification. For
example, in the example given below, the OID of the notification is "ems 27"


endOfResponseNotification  NOTIFICATION-TYPE
         OBJECTS {
                            endOfMessageString
                         }
        STATUS current
        DESCRIPTION
                        "This specific notification is sent when the agent
finishes sending all notifications of a particular type"
        ::= { ems 27}

The associated code to send the notification using SNMP4J is given below
where I dont set the value "ems 27" anywhere but still my SNMP manager
receives the trap. Could you please let me know how the manager can identify
the notification OID, in this case "ems 27"?

Suppose, the OID for the object endOfMessageString is
1.3.6.1.4.1.99.12.19.1.1.1.1.90.5

-----------------------------------------------------------------------------------------------------------------------------------------------
  PDU pdu = new PDU();
  String stringValue = "End of Message";
  VariableBinding varbind = new VariableBinding(new OID("
1.3.6.1.4.1.99.12.19.1.1.1.1.90.5"),new OctetString(stringValue));
  pdu.add(varbind);
  pdu.setType(PDU.NOTIFICATION);
  Address addr = new UdpAddress(InetAddress.getByName("machine01"), 162);
  target.setAddress(addr);
  target.setRetries(2);
  target.setTimeout(1500);
  target.setVersion(SnmpConstants.version2c);

  ResponseEvent resp= snmp.send(pdu, target);

------------------------------------------------------------------------------------

Any help in this respect is highly appreciated.
Thanks
Best Regards
Vinod.



More information about the SNMP4J mailing list