This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes snmp4j variable bindings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "snmp4j variable bindings" Watch "snmp4j variable bindings" New topic

snmp4j variable bindings

mansi sabharwal

Joined: May 10, 2011
Posts: 4
I am trying to use snmp4j to send traps to a client.
I want to associate the bindings to the trap in a way that i can have a name for each value i'm passing along with the type of the value.

Previously i was doing this using an arraylist and appending the command to it.. which was being run by the process builder. The command looked like this:

command.add(mibName + "::" + "notificationID");
+ perfConseqNotificationRel.getPerfnotificationid().getId()
+ "");

In this 'notificationID' is the name of the attribute.
'i' is the type i.e. integer value
and 'perfConseqNotificationRel.getPerfnotificationid().getId()' is the value i will b getting.

I'm trying to do the same with snmp4j, in the following way

pdu.add(new VariableBinding(oid, new OctetString("Notification Id value")));

But in the above, i am only able to bind the value of the variable to an OID, whereas I want to bind it to a name.
Can the above be done in snmp4j ??
I agree. Here's the link:
subject: snmp4j variable bindings
It's not a secret anymore!