[SNMP4J] Table Index Interesting Problem

Angela Gao angela.gwh at gmail.com
Thu Dec 28 14:12:11 CET 2006


Hi, all,

I use table to store data. But I find an strange problem when
retrieve/change data through SNMP.getnext and SNMP.set.

For example,  I add three rows in table.

  Variable[] rowValues0 = new Variable[] {
          new Integer32(6),
          new OctetString("ZeroIndexRow"),
          new Integer32(9),
     };

  Variable[] rowValues1 = new Variable[] {
          new Integer32(4),
          new OctetString("HelloWorld"),
          new Integer32(7),
     };

  Variable[] rowValues2= new Variable[] {
          new Integer32(5),
          new OctetString("HappyNewyear"),
          new Integer32(8),
     };


        hostInfoEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("0"),
rowValues0));

        hostInfoEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("1"),
rowValues1));

        hostInfoEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("2"),
rowValues2));

When I Snmp.getnext, I only can retrieve row with row index OID("1") and
OID("2");
when I SNMP.set , the row with index OID("1") can be changed, no error
returned.

but If I only add two rows,
        hostInfoEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("1"),
rowValues1));

        hostInfoEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("2"),
rowValues2));
When I SNMP.getnext, I can retrieve both two row;
When I SNMP.set, errors 11 will be returned in response message.

1. May I draw this conclusion: Table row index must start from OID("1") ?
OID("0") is not correct?
2. According to my understanding, table colum value(which is aggregate data
type) can not be changed by SNMP.set  is that right?

-- 
Best regard,
Angela



More information about the SNMP4J mailing list