c - Delayed Table Initialization -
using net-snmp api , using mib2c generate skeleton code, possible support delayed initialization of tables? mean is, table not initialized until of it's members queried directly. reason member data obtained server, , i'd able start snmpd daemon without requiring other server online/ready requests. thought of maybe initializing table dummy data gets updated real values when member queried, i'm not sure if best way.
the table has 1 row of entries, using mib2c.iterate.conf generate table iterators , dealing of seems unnecessary. thought of maybe implementing sequence defined in mib , not actual table, that's not how it's done in examples i've seen. looked @ /mibgroup/examples/delayed_instance.c, that's not quite i'm looking for. using mib2c mib2c.create-dataset.conf config file closest got getting work easily, config file assumes data static , not external (both of not true in case), won't work. if it's not done, i'll implement sequence , not table, i'm hoping there's easy way. in advance.
the iterator method work fine. won't load data until calls _first , _next routines. it's you, in routines , in _handler routine, request data remote server. in fact, default, doesn't cache data @ it'll make query remote server every request. can slow if have lot of data in table, adding cache store data n seconds advisable in case.
Comments
Post a Comment