[AGENT++] newbie MibTable question

Hong Chen hchen at portrait.com
Fri May 7 03:58:21 CEST 2004


hi folks,

This is a newbie question about MibTable.

I have a table defined as this :

devEntry {
	devIndex,  -- index
	devName, -- read-only
	...
	devLock -- read-write
}

All the device information can be retrieved from a system config file.
'devLock' is the only object that could be set ( otherwise it should be
fairly easy to use 'MibStaticTable' and 'MibStaticLeaf')

What I want to do is to create an instance for each device from the system
config file when snmp agent is started up. Once the agent is up, I may do a
snmpset against devLock object.

To implement this, I define the classes
class devEntry : public MibTable {
...
};

class devName : public MibLeaf {
...
};

class devLock : public MibLeaf {
...
};

To add the instances to the devTable,

devEntry* pDevEntry = new devEntry(...);

MibTableRow pRow = pDevEntry->add_row(...);
pRow->add(new devName(...)...);
pRow->add(new devLock(...)...);
...
mib.add(pDevEntry);
...

I guess this is not quite right as I don't see the devName, devLock objects
added when the agent is started up, and a snmpwalk don't find the objects.

Should I use other method to add these pre-loaded data, like
MibTable::add_col() ?

thanks in advance
hong




More information about the AGENTPP mailing list