[AGENT++] index values and dynamic MibTables

Razvan Cojocaru razvan.cojocaru at kaspersky.ro
Wed Jul 4 17:22:00 CEST 2007


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!


-- 
Razvan Cojocaru
KeyID: 1024D/04CA34DE




More information about the AGENTPP mailing list