Adding rows to a mib

Eoin O'Sullivan Eposullivan____mcom.cit.ie
Tue Apr 24 18:36:06 CEST 2001


Hi,
Thanks for all your help so far.
I'm sorry to bother you with another simple question, but:

I have a mib compiled with AgentGen, and load it as done in
the sample agents. I can do an snmpGet on the singleton leafs.
My trouble is down to my inexperience with Snmp as much as
Snmp++V3. I have the following:

#define oidEntSensorThresholdTable       "1.3.6.1.4.1.9.9.91.1.2.1"
#define oidEntSensorThresholdEntry       "1.3.6.1.4.1.9.9.91.1.2.1.1"

The oidEntSensorThresholdEntry has an oidEntSensorThresholdIndex at
"1.3.6.1.4.1.9.9.91.1.2.1.1.1", and has 5 columns added to it.

I am trying to add a row and populate these columns, and then retrieve
and set their values. The examples haven't been much help. The functions
available to me are:

ready_for_service(Vbx*, int);
row_added(MibTableRow*, const Oidx&, MibTable*);
row_delete(MibTableRow*, const Oidx&, MibTable*);
row_init(MibTableRow*, const Oidx&, MibTable*);
row_activated(MibTableRow*, const Oidx&, MibTable*);
row_deactivated(MibTableRow*, const Oidx&, MibTable*);
set_row(MibTableRow* r, long p0, long p1, long p2, long p3, long p4);

I understand I have to add this row and set it in the main agent code,
but have been unable to do it, partially as I am unsure of what to add
for the Index.The code I have been attempting is:

Oidx TestOid = "I don't know what to put here";
entSensorThresholdEntry *test = new entSensorThresholdEntry();
MibTableRow* row = test->instance->add_row(TestOid); 

(Is add_row a usable function here? I only saw row_added())

test->set_row(row,1,5,0,1,1);
mib.add(new entSensorThresholdEntry(test));

I have unsuccessfully tried to get this to work. Is the Index
5.1.5.0.1.1 , for the number of entries and what they are, or
am I completely off the mark? If you can help me with this, or
give me an example of adding rows like this I would greatly 
appreciate.

Sorry for taking up your time with such a lengthy and 
simple problem. Thanks in advance,

Eoin 





More information about the AGENTPP mailing list