On 14 March 2011 21:11, anant garg <garg.an...@gmail.com> wrote:
> I have some scalar objects. The data for these objects is with external
> process ( not with SNMP Agent).
> Which mib2c configuration file to use so that on SNMP user request  I can
> fetch the data from other process ( API interface) and send back to user ?

If you are using scalar objects, then you should use the 'mib2c.scalar.conf'
template.    This will give you the basic framework of the necessary code.

How you obtain the value(s) to return is outside the scope of this template.
You'd need to insert the appropriate API calls to retrieve the corresponding
value(s) from your other process.


> Should I go for caching the data ?

That's up to you.
If retrieving the data is likely to take a while, then this would be a sensible
approach.  The cleanest approach would be to insert a 'cache_helper'
into the handler chain before registering it, and have the load hook retrieve
the data - this would work in exactly the same way as for table objects.
(You could even have the one cache retrieve the data for *all* the scalar
objects in one go, if this would be more efficient).

  If retrieving the data is a relatively trivial and quick operation, then it
may not be necessary to maintain a cache.   Just make the relevant API
call as part of the scalar object handler.

Dave

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to