Hi I am registering table with snmp agent as: public static MOTable<MOTableRow<Variable>, MOColumn<Variable>, MOTableModel<MOTableRow<Variable>>> createTableFromJSON( JSONObject data) { MOTable table = null;
if (data != null) { MOTableSubIndex[] subIndex = new MOTableSubIndex[] { moFactory .createSubIndex(null, SMIConstants.SYNTAX_INTEGER, 1, 100) }; MOTableIndex index = moFactory.createIndex(subIndex, false, new MOTableIndexValidator() { public boolean isValidIndex(OID index) { boolean isValidIndex = true; return isValidIndex; } }); Object indexesObj = data.get("indexValues"); if(indexesObj!=null){ String indexes = data.getString("indexValues"); String tableOID = data.getString("tableId"); JSONArray columnArray = data.getJSONArray("columns"); int columnSize = columnArray.size(); MOColumn[] columns = new MOColumn[columnSize]; Variable[] initialValues = new Variable[columnSize]; for (int i = 0; i < columnSize; i++) { JSONObject columnObject = columnArray.getJSONObject(i); columns[i] = moFactory.createColumn(columnObject .getInt("columnOID"), columnObject.getInt("dataType"), moFactory.createAccess(columnObject .getInt("accessType"))); initialValues[i] = getVariable(columnObject.get("defaultValue")); } MOTableModel tableModel = moFactory.createTableModel(new OID( tableOID), index, columns); table = moFactory.createTable(new OID(tableOID), index, columns, tableModel); String[] indexArrString = indexes.split(";"); for(String indexStr: indexArrString){ MOTableRow<Variable> row = createRow(new Integer(indexStr.trim()), initialValues); table.addRow(row); } } } return table; } where json data is this: { "tableName": "table1", "tableId": ".1.3.6.1.4.1.1.201.6.1", "columns": [ { "columnName": "column1", "columnOID": 1, "dataType": 70, "accessType": 1, "defaultValue":0 }, { "columnName": "column2", "columnOID": 2, "dataType": 70, "accessType": 1, "defaultValue":0 }, { "columnName": "column3", "columnOID": 3, "dataType": 70, "accessType": 1, "defaultValue":0 }, ] } Now i have a table with oid .1.3.6.1.4.1.1.201.6.*1* where 1 is entry id and 6 is table id. I have registered multiple rows with 1, 2, 3 row index. Now If i send values for rowindex 1 i.e. oid= .1.3.6.1.4.1.1.201.6.1.1.1 then this will set values for .1.3.6.1.4.1.1.201.6.1.1.1 .1.3.6.1.4.1.1.201.6.1.1.2 .1.3.6.1.4.1.1.201.6.1.1.3 The method which i am using for publishing snmp params is: public void pushValue(String oid, Object value) { _log.debug("Enter pushValue "); VariableBinding binding = new VariableBinding(); binding.setOid(new OID(oid)); binding.setVariable(MOCreator.getVariable(value)); // publish snmp parameter * DefaultMOServer.setValue(getServer(), null, binding);* } I debug the code when control goes to* DefaultMOServer.setValue(getServer(), null, binding); , it internally when reach DefaultMoTable class's setValue() method then it set values of all columns independent of row index. * *Please let me know what i am missing ? * On Wed, Aug 28, 2013 at 4:03 AM, Frank Fock <f...@agentpp.com> wrote: > As I already mentioned: the SNMP4J-Agent code cannot cause this > misbehavior. > > You will have to debug your code to find the problem source... > > Frank > > Am 27.08.2013 06:34, schrieb Hanish Bansal: > > Thats the problem i am facing. I debugged the code and everything is > looking fine. I am able to register table with SNMP agent with their > default values 0. > > When i get using *snmpwalk* command I am able to see different row > indexes with all column's default value 0. After publishing value for a row > index using above code(Shared in last mail) values of all columns for all > row indexes get changed. > > > On Mon, Aug 26, 2013 at 6:40 PM, Frank Fock <f...@agentpp.com> wrote: > >> Hi, >> >> I think the error is located in your code. I cannot see >> from the SNMP4J-Agent code in DefaultMOTable >> how it would be able to modify cells from other >> columns or rows than specified if the specified OID >> is a valid instance OID for that table. >> >> Best regards, >> Frank >> >> Am 26.08.2013 10:38, schrieb Hanish Bansal: >> >> I am using below code to publish snmp parameters: >> >> public void pushValue(String oid, Object value) { >> _log.debug("Enter pushValue "); >> VariableBinding binding = new VariableBinding(); >> binding.setOid(new OID(oid)); >> binding.setVariable(MOCreator.getVariable(value)); >> // publish snmp parameter >> DefaultMOServer.setValue(getServer(), null, binding); >> _log.debug("Exit pushValue "); >> } >> >> >> Let me know if any more information required. >> >> >> >> On Mon, Aug 26, 2013 at 2:03 PM, Mark A. Flacy <mfl...@verizon.net>wrote: >> >>> I believe you will have to provide a code example before anyone can >>> provide meaningful suggestions. >>> >>> >>> Hanish Bansal <hanish.bansal.agar...@gmail.com> wrote: >>>> >>>> Any Suggestion ?? >>>> >>>> >>>> On Wed, Aug 14, 2013 at 9:20 AM, Hanish Bansal >>>> <hanish.bansal.agar...@gmail.com> wrote: >>>> >>>> >>>> >>>>> I am using "rowid" term for row index. I have agent configured for snmp >>>>> >>>>> table with two row indexes 111,222. >>>>> >>>>> I am publishing info using OIDs .1.3.6.1.4.1.1.102.1.1.1.111 to >>>>> >>>>> .1.3.6.1.4.1.1.102.1.1.2.111 where last digit(111) is row index. Then it >>>>> sets values for both rowindexes 111 and 222. >>>>> >>>>> >>>>> >>>>> On Tue, Aug 13, 2013 at 7:29 PM, Frank Fock <f...@agentpp.com> wrote: >>>>> >>>>> >>>>>> Hi, >>>>>> I have problems to understand your term "rowid". SMI only knows a row >>>>>> index. May be here is the source of the problem located? >>>>>> Best regards, >>>>>> Frank >>>>>> >>>>>> Am 13.08.2013 um 08:08 schrieb Hanish Bansal < >>>>>> hanish.bansal.agar...@gmail.com>: >>>>>> >>>>>>> >>>>>>> >>>>>>> Hi All, >>>>>>> >>>>>>> We are using SNMPv3 for publishing snmp parameters. We are publishing >>>>>> >>>>>> data >>>>>>> >>>>>>> >>>>>>> as snmp tables. >>>>>>> >>>>>>> I am facing an issue in below case: >>>>>>> >>>>>>> Multiple rowIDs for same component : When we are publishing parameters >>>>>> >>>>>> of >>>>>>> >>>>>>> >>>>>>> one component using different rowIds from same jvm process, >>>>>>> every-time >>>>>> >>>>>> we >>>>>>> >>>>>>> send a parameter using a rowId then it overwrite all columns value in >>>>>> >>>>>> >>>>>> that >>>>>>> >>>>>>> table independent of rowID. >>>>>>> E.g. CPU is a component(MODULE_ID=102). All CPU parameters will be >>>>>>> >>>>>>> published on 8001 port. >>>>>>> There will be multiple cpu cores on a machine then each cpu core's >>>>>>> parameters will be published using different rowID. All the rowids of >>>>>> >>>>>> all >>>>>> >>>>>>> the CPUs are set with the last sent value. >>>>>>> >>>>>>> I am using below maven dependency in my app: >>>>>>> >>>>>>> <dependency> >>>>>>> <groupId>org.snmp4j</groupId> >>>>>>> <artifactId>snmp4j-agent</artifactId> >>>>>>> >>>>>>> <version>2.0.8</version> >>>>>>> </dependency> >>>>>>> >>>>>>> Any suggestion will be helpful. >>>>>>> >>>>>>> Thanks in advance !! >>>>>>> >>>>>>> -- >>>>>>> *Regards* >>>>>>> *Hanish Bansal* >>>>>>> ------------------------------ >>>>>>> SNMP4J mailing list >>>>>>> SNMP4J@agentpp.orghttp://lists.agentpp.org/mailman/listinfo/snmp4j >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>> *Thanks & Regards* >>>>> *Hanish Bansal* >>>> >>>> >>>> >>>> >>>> >>> -- >>> Sent from my Android phone with K-9 Mail. Please excuse my brevity. >>> >> >> >> >> -- >> *Thanks & Regards* >> *Hanish Bansal* >> >> >> -- >> --- >> AGENT++ >> Maximilian-Kolbe-Str. 10 >> 73257 Koengen, Germanyhttps://agentpp.com >> Phone: +49 7024 8688230 >> Fax: +49 7024 8688231 >> >> > > > -- > *Thanks & Regards* > *Hanish Bansal* > > > -- > --- > AGENT++ > Maximilian-Kolbe-Str. 10 > 73257 Koengen, Germanyhttps://agentpp.com > Phone: +49 7024 8688230 > Fax: +49 7024 8688231 > > -- *Thanks & Regards* *Hanish Bansal* _______________________________________________ SNMP4J mailing list SNMP4J@agentpp.org http://lists.agentpp.org/mailman/listinfo/snmp4j