[SNMP4J] help with TableUtils.createRow()

Frank Fock fock at agentpp.com
Tue Jan 3 19:04:59 CET 2012


Hi,
MIB Designer does not automatically add a column with SYNTAX RowStatus, because that might not be wanted in all cases. Especially for read-only tables, RowStatus does not make sense. If you want to create a read-write (create) table, then you should add a RowStatus column. There is a RFC which explains well what the RowStatus is all about. 
Then the TableUtils will work as described in the JavaDoc.

Best regards
Frank



Am 15.12.2011 um 01:41 schrieb André Silva <andre.mr.silva at gmail.com>:

> Hi,
> 
> I'm having some dificulties understanding how to create a row with 
> TableUtils.
> 
> I have created a MIB using MibDesigner and then I've generated the code 
> using AgentPro. Now I want manager to set some rows in the created MIB 
> at the agent, but I can't find any example code nor explanation about 
> this method.
> 
> Creates a SNMP table row for a table that supports the RowStatus 
> mechanism for row creation.
> 
> What is RowStatus? A MIB created with MibDesingner supports this mechanism?
> 
> |rowStatusColumnOID|- the column OID of the RowStatus column (without 
> any instance identifier)
> 
> What should I provide in this parameter?
> 
>    |
>    rowIndex|- the OID denoting the index of the table row to create.
> 
> And rowIndex? Is the index of the row like (3) or the index OID of the 
> row in the table? (1.3......3)
> 
> 
> I got this values from the MIB code:
> 
>   public static final OID oidServerEntry = new OID(new int[] { 
> 1,3,6,1,3,1,1,3,1 });
> 
>   public static final OID oidServerid = new OID(new int[] { 
> 1,3,6,1,3,1,1,3,1,1 });
> 
> And this is my code:
> 
>         VariableBinding[] values = {
>                 new VariableBinding(new OID(new int[] 
> {1,3,6,1,3,1,1,3,1,1}),new OctetString("value1")),
>                 new VariableBinding(new OID(new int[] 
> {1,3,6,1,3,1,1,3,1,2}),new OctetString("value2")),
>                 new VariableBinding(new OID(new int[] 
> {1,3,6,1,3,1,1,3,1,4}),new OctetString("value3")),
>                 new VariableBinding(new OID(new int[] 
> {1,3,6,1,3,1,1,3,1,5}),new OctetString("value4")),
>                 new VariableBinding(new OID(new int[] 
> {1,3,6,1,3,1,1,3,1,6}),new OctetString("value5")),
>         };
>         ResponseEvent tableEvents =
>                 tableUtils.createRow(userTarget,???,???,values);
> 
> 
> I've tried a lot of values and were always  wrong.
> 
> Can anybody help me?
> 
> Thanks
> 
> 
> 
> 
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list