[AGENT++] Adding rows to MibTable?!?&In-Reply-To=1087991609023437 at lycos-europe.com

Mr. AWD mrawd at excite.com
Thu Jun 24 17:54:02 CEST 2004


The reason you are getting an infinite loop in there is due to the code that you added bellow. Basically at every request to the MibTable object an MibTable::Update() gets called and that one adds 16 new rows and initialize them to the FOR loop index.
 
You could check whether the row that you are about to add already exist. I believe that code like this would give you that:
Oidx oIndex;
for (int i=0; i<16; ++i)
{
    oIndex += get_next_avail_index();
    if (find_index(oIndex) == 0)
    { 
         MibTableRow* row = add_row(oIndex);
         row->get_nth(0)->replace_value(new SnmpInt32(i));
    }
    oIndex.clear();
}


Hope this helps.
 
 
Fedja
 
--- On Thu 06/24, Jacek Marynowski < j.maryno at lycos.de > wrote:From: Jacek Marynowski [mailto: j.maryno at lycos.de]To: agentpp at agentpp.orgDate: Thu, 24 Jun 2004 14:07:14 GMT Subject: [AGENT++] Adding rows to MibTable?!?&In-Reply-To=1087991609023437 at lycos-europe.comHi Frank,
Ja, that helps.
But let me tell about another problem.
I modified the update method from the dynamic_table example in the following fashion:
virtual void update(Request* req)
{
if (currentRequest == req->get_request_id()) return;
currentRequest = req->get_request_id();

start_synch();

for (int i=0; i<16; ++i)
{
MibTableRow* row = add_row(get_next_avail_index());
row->get_nth(0)->replace_value(new SnmpInt32(i));

}
}

Result from my NMS is an endless loop that endlessly adds rows filling them from 0 to 15.
Something like this:
SNMPv2-SMI::enterprises.4976.6.2.1.1.1 = INTEGER: 0
SNMPv2-SMI::enterprises.4976.6.2.1.1.2 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.6.2.1.1.3 = INTEGER: 2
SNMPv2-SMI::enterprises.4976.6.2.1.1.4 = INTEGER: 3
SNMPv2-SMI::enterprises.4976.6.2.1.1.5 = INTEGER: 4
 

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



More information about the AGENTPP mailing list