[SNMP4J] Issues with SET on a read-write column

adireddy.aswin at rsa.com adireddy.aswin at rsa.com
Mon Oct 31 15:51:28 CET 2011


Hi ,



I have a table with 2 indices and one read-write column.

Here is the MIB entry-



testRuntimeConfigEntry  ::=  SEQUENCE {

                testConfigHost                     OCTET STRING,

                testConfigParamName     OCTET STRING,

                testConfigParamValue      OCTET STRING

                }

-- .1.3.6.1.4.1.2197.10.1.3.12.1



        testConfigHost     OBJECT-TYPE

                SYNTAX     OCTET STRING

                ACCESS     not-accessible

                STATUS     current

                ::=  {  testConfigEntry  1  }



        testConfigParamName        OBJECT-TYPE

                SYNTAX             OCTET STRING

                ACCESS             not-accessible

                STATUS             current

                ::=  {  testConfigEntry  2  }



        testConfigParamValue       OBJECT-TYPE

                SYNTAX             OCTET STRING

                ACCESS             read-write

                STATUS             current

                ::=  {  testConfigEntry  3  }



I have created a community "public".

I'm able to do a walk on this table, no issues.

(Currently I'm using iReasoning to get the table view)



But when I do a SET, using "public" community, I get the following response

RESPONSE[requestID=6891380, errorStatus=Unable to create object(11), errorIndex=1, VBS[1.3.6.1.4.1.2197.10.1.3.12.1.3.1 = 30]]



I have fiddled around with all possible view mappings, and I still got the same error.

After some digging around, I did manage to create another community "private".



Now when I do a SET, using "private" community, on the read write column, I get the following response

RESPONSE[requestID=620227330, errorStatus=General variable binding error(5), errorIndex=0, VBS[1.3.6.1.4.1.2197.10.1.3.12.1.3.1 = 30]]



I'm using the following snippet  to set the data

//...

pdu.add(new VariableBinding(new OID(strOID), new OctetString(valueToSet)));

pdu.setType(PDU.SET);

ResponseListener listener = new ResponseListener() {

            public void onResponse(ResponseEvent event) {

              ((Snmp)event.getSource()).cancel(event.getRequest(), this);

              PDU strResponse = event.getResponse();

              if (strResponse!= null)

                System.out.println (strResponse.getErrorStatusText());

              else

                  System.out.println("Response is null");

            }};

            snmp.send(pdu, target, null, listener);

            snmp.close();



Here is a snippet of my view mappings and communities-



//same for public community as well



Variable[] com2sec1 = new Variable[] { new OctetString("private"), //community name

                                                                new OctetString("cprivate"), // security name

                                                                getAgent().getContextEngineID(), // local engine ID

                                                                new OctetString("private"), // default context name

                                                                new OctetString(), // transport tag

                                                                new Integer32(StorageType.nonVolatile), // storage type

                                                                new Integer32(RowStatus.active) // row status

                                };



                                MOTableRow row1 = communityMIB.getSnmpCommunityEntry().createRow(

                                                                new OctetString("private").toSubIndex(true), com2sec1);

                                communityMIB.getSnmpCommunityEntry().addRow(row1);



vacm.addGroup(SecurityModel.SECURITY_MODEL_SNMPv2c,

                 new OctetString("cprivate"),

                 new OctetString("v1v2group"),

                 StorageType.nonVolatile);



vacm.addAccess(new OctetString("v1v2group"), new OctetString("private"),

                                   SecurityModel.SECURITY_MODEL_SNMPv2c,

                                   SecurityLevel.NOAUTH_NOPRIV,

                                   MutableVACM.VACM_MATCH_EXACT,

                                   new OctetString("fullReadView"),

                                   new OctetString("fullWriteView"),

                                   new OctetString("fullNotifyView"),

                                   StorageType.nonVolatile);



vacm.addViewTreeFamily(new OctetString("fullWriteView"), new OID(".1.3.6.1.4.1.2197.10.1.3.12.1.3"),

                    new OctetString(), VacmMIB.vacmViewIncluded,

                    StorageType.nonVolatile);



What am I missing here or what am I doing wrong here?

Appreciate any help.

Thanks in advance.



Regards,

Aswin






More information about the SNMP4J mailing list