[SNMP4J] Adding data to Table with multiple indices in SNMP4J-Agent
minreddy minreddy
minreddy at yahoo.com
Thu Jul 19 12:15:36 CEST 2007
I have a table with two indices as shown below
------------------------------------------------------------
RS-MIB
rSys OBJECT IDENTIFIER ::= { enterprises 31420 }
rsTable OBJECT-TYPE
SYNTAX SEQUENCE OF RsOutputsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { rSys 1 }
rsOutputsEntry OBJECT-TYPE
SYNTAX RsOutputsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { rsLevelID,
rsOutputID }
::= { rsTable 1 }
RsOutputsEntry ::= SEQUENCE {
rsLevelID Integer32, -- rsOutputsEntry 1
rsOutputID Integer32, -- rsOutputsEntry 2
rsOutputsName DisplayString, -- rsOutputsEntry 3
rsOutputState TruthValue -- rsOutputsEntry 4
}
-------------------------------------------------------------------------------------------------------------
The code generated by agentpro for multiple indices are
rsOutputsEntryIndexes =
new MOTableSubIndex[] {
moFactory.createSubIndex(oidRsLevelID,
SMIConstants.SYNTAX_INTEGER, 1, 1),
moFactory.createSubIndex(oidRsOutputID,
SMIConstants.SYNTAX_INTEGER, 1, 1) };
Now the question is how to add row.
I have created a row like as shown below
Variable[] rowValues1 = new Variable[] {
new Integer32(2),
new Integer32(34),
new OctetString("good"),
new Integer32(1)
}
rsOutputsEntryModel.addRow(new DefaultMOMutableRow2PC(new OID("1"), rowValues1))
When i try to get rsOutputsName
%snmpget rSys.rsTable.rsOutputsEntry.rsOutputsName.2.3
No Such Instance currently exists at this OID
Any help will be appreciated.
rgds
Minred
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
More information about the SNMP4J
mailing list