Hi Réda, Please don't use the MOTableBuilder, it is not part of SNMP4J-Agent and it is probably the source of the problem. I assume that the index you use does not match the table's index definition. Best regards, Frank
> Am 30.10.2015 um 15:44 schrieb Réda BENKIRANE <[email protected]>: > > Hello. I am trying to set a value in an MOTable. The MOTable elements > MAX_ACCESS is defined as ACCESS_READ_WRITE. > MOTableBuilder customBuilder = new MOTableBuilder(customTable) > .addColumnType(1, SMIConstants.SYNTAX_OCTET_STRING, > MOAccessImpl.ACCESS_READ_WRITE) .addColumnType(2, > SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_WRITE) > .addColumnType(3, SMIConstants.SYNTAX_INTEGER, > MOAccessImpl.ACCESS_READ_WRITE) .addRowValue(new > OctetString("192.168.1.10")) .addRowValue(new > Integer32(0)) .addRowValue(new Integer32(100)) > .addRowValue(new OctetString("192.168.1.11")) > .addRowValue(new Integer32(0)) .addRowValue(new > Integer32(200)); > agent.registerManagedObject(customBuilder.build()); > And however, when I send a SET to the agent, I get the error "Not Writeable" > and I don't get it. > final static OID[] customTableExistingOIDs = new OID[]{new > OID("1.3.6.1.2.1.3.3.1"), > new OID("1.3.6.1.2.1.3.3.2")}; customTablePDU.addAll(new > VariableBinding[]{new VariableBinding(customTableExistingOIDs[0],new > Integer32(8989)), new > VariableBinding(customTableExistingOIDs[1],new Integer32(8989))}); > customTablePDU.setType(PDU.SET); Snmp customSnmp = new Snmp(transport); > System.out.println("Request:\nSending CustomTable Snmp Set Request to > Agent..."); ResponseEvent customTableResponse = > customSnmp.set(customTablePDU, comtarget); > Agent side ERROR : > java.lang.Exception: Error 'Not writable' generated at: 1.3.6.1.2.1.3.3.1 = > 8989 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:661) > 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) > Any help will be really appreciated. Thank you > > Réda BENKIRANE > _______________________________________________ > SNMP4J mailing list > [email protected] > https://oosnmp.net/mailman/listinfo/snmp4j _______________________________________________ SNMP4J mailing list [email protected] https://oosnmp.net/mailman/listinfo/snmp4j
