[AGENT++] index values and dynamic MibTables

Razvan Cojocaru razvan.cojocaru at kaspersky.ro
Wed Jul 4 19:20:02 CEST 2007


Well, I'm simply using the default MibTable constructor. Is the default
to have not-accessible index columns? Will adding an index_info object
to the list of MibTables parameters help that?

Frank Fock wrote:
> Hello Razvan,
> 
> I have too few information to fully understand
> your problem, but I guess that you added a
> "not-accessible" index column to your table
> which you should not - because it is not
> accessible and therefore it should not be
> implemented as MibLeaf.
> 
> Hope this helps.
> 
> Best regards,
> Frank
> 
> Razvan Cojocaru wrote:
>> Hello.
>>
>> My MIB looks like this:
>>
>> -- SNIP --
>>
>> MyTableType ::= SEQUENCE {
>>     tableIndex Integer32,
>>     MyTablePriority Unsigned32,
>>     MyTableSenders OCTET STRING,
>>     MyTableRecipients OCTET STRING
>> }
>>
>> -- SNIP --
>>
>> My C++ code looks like this:
>>
>> -- SNIP --
>>
>> MyTable::MyTable()
>>     : MibTable(OID)
>> {
>>     add_col(new MibLeaf("1", READWRITE, new SnmpUInt32(0), true));
>>     add_col(new MibLeaf("2", READWRITE, new OctetStr(""), true));
>>     add_col(new MibLeaf("3", READWRITE, new OctetStr(""), true));
>> }
>>
>> -- SNIP --
>>
>> When walking my table, I get errors if I register the MIB file, on
>> account of the index. Apparently this tells the master agent that the .1
>> OID should be the index, not my "1" MibLeaf.
>>
>> So far I've added these critters to the mix:
>>
>> const index_info indMyTable[1] = {
>>   { sNMP_SYNTAX_INT, FALSE, 1, 1 }
>> };
>>
>> and I'm passing them along to the MibTable constructor, but I'm not sure
>> that's the right thing to do under the circumstances. Should I manually
>> add an index column from "1" and start the others from "2"? What would
>> you recommend for me to do so that the MIB file will correspond to my
>> code?
>>
>> Thanks for your time!
>>
>>
> 




More information about the AGENTPP mailing list