[SNMP4J] Get an error when i try to set a entry of a table

Giuseppe Giusti giuseppe.giusti at syncromed.it
Mon Feb 3 10:21:38 CET 2014


When i try to set a scalar i have no problem but when i try to set a entry
of a table i get an error
why?


this is the models table

 MOTableSubIndex[] subIndexes
                = new MOTableSubIndex[]{new
MOTableSubIndex(SMIConstants.SYNTAX_INTEGER)};
        MOTableIndex indexDef = new MOTableIndex(subIndexes, false);
        MOColumn[] columns = new MOColumn[11];
        int c = 0;
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // IndexCh Integer
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_OCTET_STRING,
                        MOAccessImpl.ACCESS_READ_WRITE);// nameCh
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // acq Daily
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // acq Weekly
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // acq Monthly
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // acq Yearly

        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // rejected Daily
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // rejected Weekly
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // rejected Monthly
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // rejected Yearly
        columns[c++]
                = new MOColumn(c, SMIConstants.SYNTAX_INTEGER,
                        MOAccessImpl.ACCESS_READ_ONLY); // not Assigned To
Volume

    DefaultMOTable ifTable
                = new DefaultMOTable(new OID(".1.3.6.1.4.1.28708.1.1.1",
indexDef, columns);

        MOMutableTableModel model = (MOMutableTableModel)
ifTable.getModel();
        ifTable.setVolatile(false);

        agent.registerManagedObject(ifTable);


the second columns is set to read and write so,
are all OIDs under the prefix 1.3.6.1.4.1.28708.1.1.1.2 writeable?


   when i try to set OID entry 1.3.6.1.4.1.28708.1.1.1.2.3  i get :

Set request for OID  1.3.6.1.4.1.28708.1.1.1.2.3
 class org.snmp4j.smi.OctetString     set-value: changeValue

date:Mon Feb 03 10:13:38 CET 2014

java.lang.Exception: Error 'Not writable' generated at:
1.3.6.1.4.1.28708.1.1.1.2.3 = changeValue



More information about the SNMP4J mailing list