Reputation: 53
I am currently on a project of building an SNMP agent and manager with Java using SNMP4J API.
I created an MOTable with 3 columns and then try to send a set from the client to create a new row in the MOTable conceptual table.
Here is the extract of my client code that adds the Variable Binding to the PDU and then sends the SNMP SET to the agent :
final static OID[] customTable = new OID[]{new OID(".1.3.6.1.2.1.3.1"),
new OID(".1.3.6.1.2.1.3.2"),
new OID(".1.3.6.1.2.1.3.3")};
PDU customTablePDU = new PDU();
customTablePDU.addAll(new VariableBinding[]{new VariableBinding(customTable[0],new OctetString("192.168.1.12")),
new VariableBinding(customTable[1],new Integer32(0)),
new VariableBinding(customTable[2],new Integer32(100))});
ResponseEvent customTableResponse = customSnmp.set(customTablePDU, comtarget);
the ".1.3.6.1.2.1.3.x" with x = 1, 2 or 3 are respectively the OIDs of columns 1, 2 and 3 of my table which respectively contains an OctetString, and Integer32 and a second Integer32.
Unfortunately, I get the following error when I run the client :
Do you know what this error mean and how to solve it in order to create a row ?
java.lang.Exception: Error 'Inconsistent naming used' generated at: 1.3.6.1.2.1.3.1 = 192.168.1.12 at org.snmp4j.agent.request.SnmpRequest$SnmpSubRequest.requestStatusChanged(SnmpRequest.java:621) at org.snmp4j.agent.request.RequestStatus.fireRequestStatusChanged(RequestStatus.java:89) at org.snmp4j.agent.request.RequestStatus.setErrorStatus(RequestStatus.java:52) at org.snmp4j.agent.mo.DefaultMOTable.prepare(DefaultMOTable.java:601) at org.snmp4j.agent.CommandProcessor$SetHandler.prepare(CommandProcessor.java:830) at org.snmp4j.agent.CommandProcessor$SetHandler.processPdu(CommandProcessor.java:863) at org.snmp4j.agent.CommandProcessor$SetHandler.processPdu(CommandProcessor.java:780) at org.snmp4j.agent.CommandProcessor.processRequest(CommandProcessor.java:422) at org.snmp4j.agent.CommandProcessor.processRequest(CommandProcessor.java:384) at org.snmp4j.agent.CommandProcessor.dispatchCommand(CommandProcessor.java:340) at org.snmp4j.agent.CommandProcessor$Command.run(CommandProcessor.java:560) at org.snmp4j.agent.CommandProcessor.processPdu(CommandProcessor.java:163) at org.snmp4j.MessageDispatcherImpl.fireProcessPdu(MessageDispatcherImpl.java:675) at org.snmp4j.MessageDispatcherImpl.dispatchMessage(MessageDispatcherImpl.java:302) at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:373) at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:333) at org.snmp4j.transport.AbstractTransportMapping.fireProcessMessage(AbstractTransportMapping.java:76) at org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:423) at java.lang.Thread.run(Thread.java:745)
Upvotes: 1
Views: 693
Reputation: 6556
It means that the specified object does not exist. You have to check the error index in PDU to find out which variable (SNMP varbind) caused the problem.
Upvotes: 1