[SNMP4J] help with TableUtils.createRow()

André Silva andre.mr.silva at gmail.com
Tue Jan 3 02:07:49 CET 2012


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








More information about the SNMP4J mailing list