A question

Alex Finogenov afinogenov____malibunet.com
Tue Nov 20 00:08:54 CET 2001


Frank,

The problem is mostly with GETNEXT & GETBULK, and I do believe that a lot of
CPU time and other resources are wasted. The reason for this is that if the
process of accessing persistent values in the overloaded MibTable::update()
fails and the respective table rows are not populated, the agent continues
to walk the MIB through other tables until it either succeeds in loading a
table, or hits the EndOfMib. This will potentially involve retrieving
database objects that have nothing to do with a particular SNMP request, and
thus will result in pure waste of all resources (CPU. network, etc.) In case
of access failure to the entire database (i.e. subsequently to every table),
this may slow down the agent's response time significantly. Thus I think it
is important to be able to quit after a failure in the update() ASAP.

A similar MibTable::update() failure for a SET request is not a matter of
concern, because as you mentioned, in MibTable::update() I set the error and
check it in my implementation of the overloaded
MibTable::prepare_set_request(), whose interface DOES allow to return an
error. Even in the worst case this situation may not result in any serious
waste of resources.

Maybe it does make sense to have a "way out" in MibTable::update() to return
a failure, at least for the sake of GETNEXT and GETBULK?

Thanks,
Alex

> -----Original Message-----
> From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
> Sent: Monday, November 19, 2001 11:35 AM
> To: Alex Finogenov
> Cc: agentpp-dl____agentpp.com
> Subject: Re: A question
> 
...
> > Frank,
> >
> > I got a strange error reply on my submission to 
> 'dlmanager at agentpp.com', so
> > I am forwarding this message directly to you.
> >
> > I overloaded MibTable::update() to retrieve data from repository and
> > hardware, and populate the rows. Is there a way to 
> interrupt the agent's
> > processing if an error occurred during this process?
> 
> No. The update method should not fail. Nevertheless, it may, but this
> should only be a very rare case! So, IMHO there is no need the return
> any error code while doing a update. However, you can as you described
> below by remembering the error status of the operation and returning
> it while one of the table's instrumentation methods 
> (pepare_set_request, ...)
> are called.
> 
> >
> > I do report a GenError if during the database access by calling
> > Mib::requestList->error(req->get_transaction_id(), 
> subRequestId, status) ,
> > but I would like to stop wasteful continuation of the 
> agent's computations
> > after this call and go straight to sending a response, and 
> then back to
> > listening for requests. Since MibTable::update() is void, 
> Mib::find_next()
> > (during, say, GetNext request invokes MibTable::update() 
> and from that point
> > always returns SNMP_ERROR_SUCCESS.
> 
> Are you sure that doing a shortcut here will save significant 
> CPU time?
> 
> >
> >
> > Do you have an advise for me without making modifications 
> to the Agent++
> > libraries or overloading a large piece of code? So far I 
> have managed not to
> > do any of this.
> 
> It would be difficult and I would not recommend it.
> 
> Hope this helps anyway.
> 
> Best regards,
> Frank
> 
> 



More information about the AGENTPP mailing list