[SNMP4J] Problems with the query of a DefaultMOTable

Frank Fock fock at agentpp.com
Tue Jul 17 23:26:44 CEST 2012


Hi,

You have fooled yourself with the line
  columns[c++] = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
I guess the index column is created as 0 instead
of 1, but you request column 1 (which does not exists).

Best regards,
Frank

On 17.07.2012 18:09, Alessio Gastaldo wrote:
> Hello Frank,
>
> I create a table with the following code:
>
>   private static DefaultMOTable createStaticIfTable() {
>          MOTableSubIndex[] subIndexes = new MOTableSubIndex[] { new
> MOTableSubIndex(SMIConstants.SYNTAX_INTEGER) };
>          MOTableIndex indexDef = new MOTableIndex(subIndexes, false);
>          MOColumn[] columns = new MOColumn[1];
>          int c = 0;
>          columns[c++] = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
> MOAccessImpl.ACCESS_WRITE_ONLY); // ifIndex
>          DefaultMOTable ifTable = new DefaultMOTable(new
> OID("1.3.6.1.2.1.33.1.2"), indexDef, columns);
>          MOMutableTableModel model = (MOMutableTableModel)
> ifTable.getModel();
>          Variable[] rowValues1 = new Variable[] { new Integer32(22) };
>          model.addRow(new DefaultMOMutableRow2PC(new OID("0"),
> rowValues1));
>          ifTable.setVolatile(true);
>          return ifTable;
>
>      }
>
> The table is inside a TestAgent. When I try to send a  GET request (from a
> SNMP manager) for the OID: 1.3.6.1.2.1.33.1.2.1.0, I've the following
> error:
>
> Error Status = 2
> Error Index = 1
> Error Status Text = No such name
>
> Where am I doing wrong? In the OID?
>
> Thanks in advance for your answer.
>
> Best Regards
>
> Alessio
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list