Hi,

Hoping somebody might be able to assist me with this.

I can manually update the cache timeout for a table uusing a  snmp get
request as in:

snmpset -v 2c -c private 10.128.19.86 nsCacheTimeout.1.3.6.1.4.1.1900.1.1.2
i 0

This sets the cache time out value for the oid listed above.

However, what I really want to do is that my hsared object can update this
value if configured to do so, i.e.   do it programmatically.


I see my change working as follows:

My shared object registers a new configuration token which allows a user to
specify a time out value.

If this token is set then I want my shared object to read the new value and
update the cache time out for that table to be the new value.

I can get the existing cache object by calling netsnmp_cache_find_by_oid.

I presume I would need to remove the existing cache handler and create and
inject a new cache handler.

However, to create and/or inject handlers I need the
netsnmp_handler_registration object associated with my table.

I can't see any way of retrieving this using the API.  It is created in my
interface code  and I assume stored in the netsnmp subtree somewhere.

Can somebody please tell me if what I'm trying to do is possible?  If so,
what is the correct way of doing it.

I've looked at the existing net-snmp source, both core agent code and mib
code, but can't see any examples of how this might be achieved.

If its not possible, then I'd also like to know, as then at least I can stop
trying to figure out how I can do it.

Many thanks,

Tim

-----Original Message-----
From: Tim Culhane [mailto:tim.j.culh...@gmail.com] 
Sent: 07 April 2015 09:54
To: 'Net-SNMP Coders'
Subject: FW: making the cache timeout for container_load to be configurable

Hi there,

Anybody have ideas on how I can achieve the below?

I'd really like for cache times for tables in snmp shared objects to be
configurable rather than been hard coded when the shared object is
originally initialised.

Is there some way of changing the default cache time after the shared object
is loaded?

Thanks,

Tim


-----Original Message-----
From: Tim Culhane [mailto:tim.j.culh...@gmail.com] 
Sent: 01 April 2015 15:52
To: 'Net-SNMP Coders'
Subject: making the cache timeout for container_load to be configurable

Hi,

I'd like to be able to configure the length of the cache timeout  for
container_load by way of a token in the snmpd.conf file.

However, this doesn't seem possible at the moment, because by the time  we
parse the snmpd.conf file the cache time has been set up in
_xxx_container_init() in the _xxx_interface.c file Note  that 'xxx'
represents the tablename in question.

Note that I'm using code generated from mib2c.

I can't even do something like remove the existing cache handler in my
config load handler and add a new one since a lot of the variables are local
to my interface source file.

Does anybody know if it is possible to configure a cache for the
container_load via the snmpd.conf file?

Thanks,

Tim



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to