[SNMP4J] set a tablerow

Frank Fock fock at agentpp.com
Wed Mar 12 00:47:40 CET 2014


Hi Stefan,

You can, of course, create a row in any SNMP table that supports row 
creation
by sending one or more SET PDUs with SNMP4J.

However, if there is no RowStatus column in that table then it totally 
depends on
the agent how the row can be created. How a row is then created should be
documented in the table's MIB specification.

This is not an issue we can solve.

Best regards,
Frank


Am 11.03.2014 10:48, schrieb Stefan Sanner:
>
>
> Hello everyone,
>   
> I have written a similar question around 2 weeks ago, but I couldn't make any progress.
>
> I still try to add and modify rows in a table wich don't support the usage of TableUltils.createRow().
>
> I looked for an example on how to add a row with snmp4j without using this function, but I couldn't find one.
>
> Does anyone has an example on how to add a row?
>
> I tried to code a low level API solution on the basis of http://www.webnms.com/snmp/help/snmpapi/snmpv3/table_handling/snmptables_addrow.html#Low
>
> 01> SNMPClient snmp = new SNMPClient("udp:"+ ip +"/161");
> 02>
> 03> VariableBinding[] bindings={new VariableBinding(new OID( WLAN_MAC_ACL + ".1." + String.valueOf(rowCount)),new OctetString(mac)),
> 04>			        new VariableBinding(new OID( WLAN_MAC_ACL + ".2." + String.valueOf(rowCount)),new Integer32(200000)),
> 05>			        new VariableBinding(new OID( WLAN_MAC_ACL + ".3." + String.valueOf(rowCount)),new Integer32(1))};
> 06>
> 07> snmp.getUSM().addUser(new OctetString(AccessName), new UsmUser(new OctetString(AccessName),AuthMD5.ID, new OctetString(AccessPassword),PrivDES.ID, new OctetString(AccessPassword)));
> 08>		
> 09> ScopedPDU pdu = new ScopedPDU();
> 10> pdu.setType(ScopedPDU.SET);
> 11> for(int i = 0; i < Binding.length;i++)
> 12>	pdu.add(Binding[i]);	
> 13>
> 14> ResponseEvent response = snmp.send(pdu,  getUserTarget(AccessName));
>
> I try to send the content of the row within a single PDU. The return message shows:
>
> 01> 1.3.6.1.4.1.272.4.46.8.1.1.2 = 00:01:02:03:04:07
>
> , but the table hasn't changed on the router.
>
> Am I using the wrong approach or is setting a row without tableUtils.createRow() simply impossible?
>
> This is the description of the table I need to modify http://system-update.eu/snmp_manager/brickmib_9_1/tables/wlanACLTable.html
>
>
> Thanks,
>
> Stefan
>
>   		 	   		
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://s16675406.onlinehome-server.info/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list