Re: xxx_Table_handler() not being called if table is empty.

2012-03-31 Thread Dave Shield
On 30 March 2012 15:00, Francois Bouchard  wrote:
>  BTW the periodic callback that checks
> for the expired caches, do you know its frequency?

I'm not sure offhand, but I think it's set at 30s.

But bear in mind that this is the frequency of "garbage collection"
(i.e. releasing any resources that are no longer required).
It doesn't affect whether or not the agent will re-load the cached
data if it receives a request for that table.
   If the cache timeout is set to 1 or 2 seconds, then repeated
walks will typically return the latest results each time.

The periodic callback is only relevant when the agent
is no longer receiving requests for that table.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-30 Thread Francois Bouchard
Yes but the table are'nt too big.   BTW th eperiodic callback that checks
for the expired caches, do you know its frequency?

Thanks


2012/3/28 Dave Shield 

> On 28 March 2012 20:18, Francois Bouchard 
> wrote:
> > Having the timeout period to 0 could also work.
>
> If you set the cache timeout to be 0, then the load hook will be called
> for every single request - yes.
>
> Obviously, there's a performance impact here.   But if that's what
> you need, it will work.
>
> Dave
>
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Dave Shield
On 28 March 2012 20:18, Francois Bouchard  wrote:
> Having the timeout period to 0 could also work.

If you set the cache timeout to be 0, then the load hook will be called
for every single request - yes.

Obviously, there's a performance impact here.   But if that's what
you need, it will work.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Dave Shield
On 28 March 2012 19:13, Francois Bouchard  wrote:
>>  That's a  fundamental design aspect of this particular helper.
> by helper do you mean the script to build the MIB code?

No - I mean the 'table_tdata' code - see 'agent/helpers/table_tdata'.

When you register a MIB table using 'netsnmp_tdata_register',
you are setting up a _chain_ of handlers:

   The main agent framework receives a request,
   and calls 'table_helper_handler', which extracts and parses
   the index value(s) from the requested OID
   This then calls '_netsnmp_tdata_helper_handler'
   which uses these index values, together with the internal
   representation of the table, to identify which row is required
   (including converting a GETNEXT request into the equivalent GET request)
   This then calls your mib-specific handler, which can retrieve the
   table row entry identified in the previous step, and use the
   contents of that row to fulfil the request.

The key here is that _netsnmp_tdata_helper_handler knows which
rows (or more particularly, which row indexes) are valid, so
can use this information to turn GETNEXT into GET requests,
and pass the appropriate row structure to the MIB-specific routine.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Francois Bouchard
I forgot...

> But in either case, the table_data model requires the list of valid rows
> to be known *before* the table-specific handler is called.  That's a
> fundamental design aspect of this particular helper.
Is there a hook somewhere where the table could be reloaded just before the
handler - or - an alternative script to be able to call xxx_load_table()
from the handler ?

Having the timeout period to 0 could also work.

Thanks,

Francois

2012/3/28 Francois Bouchard 

> > You can actually load the column data from within the handler, but
> > at the very least - the helper needs to know the list of valid row
> indexes
> > beforehand.
> ok.
>
>
> >  That's a  fundamental design aspect of this particular helper.
> by helper do you mean the script to build the MIB code?
>
> thanks
>
>
>
> 2012/3/28 Dave Shield 
>
>> On 28 March 2012 16:26, Francois Bouchard 
>> wrote:
>> >> Which framework are you using to build the MIB code?
>> > the script used is mib2c.table_data.conf,
>>
>> Remember that the basic model for the table_data framework is that the
>> agent holds an internal representation of the table.   This may be a local
>> cached copy of some external data (using the cache helper).
>>  Alternatively it may be that the local representation is the main/only
>> form of the table.  (i.e. the table is *only* held within the agent)
>>
>> But in either case, the table_data model requires the list of valid rows
>> to be known *before* the table-specific handler is called.  That's a
>> fundamental design aspect of this particular helper.
>>
>> You can actually load the column data from within the handler, but
>> at the very least - the helper needs to know the list of valid row indexes
>> beforehand.
>>
>> Dave
>>
>
>
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Francois Bouchard
> You can actually load the column data from within the handler, but
> at the very least - the helper needs to know the list of valid row indexes
> beforehand.
ok.

>  That's a  fundamental design aspect of this particular helper.
by helper do you mean the script to build the MIB code?

thanks


2012/3/28 Dave Shield 

> On 28 March 2012 16:26, Francois Bouchard 
> wrote:
> >> Which framework are you using to build the MIB code?
> > the script used is mib2c.table_data.conf,
>
> Remember that the basic model for the table_data framework is that the
> agent holds an internal representation of the table.   This may be a local
> cached copy of some external data (using the cache helper).
>  Alternatively it may be that the local representation is the main/only
> form of the table.  (i.e. the table is *only* held within the agent)
>
> But in either case, the table_data model requires the list of valid rows
> to be known *before* the table-specific handler is called.  That's a
> fundamental design aspect of this particular helper.
>
> You can actually load the column data from within the handler, but
> at the very least - the helper needs to know the list of valid row indexes
> beforehand.
>
> Dave
>
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Dave Shield
On 28 March 2012 16:26, Francois Bouchard  wrote:
>> Which framework are you using to build the MIB code?
> the script used is mib2c.table_data.conf,

Remember that the basic model for the table_data framework is that the
agent holds an internal representation of the table.   This may be a local
cached copy of some external data (using the cache helper).
  Alternatively it may be that the local representation is the main/only
form of the table.  (i.e. the table is *only* held within the agent)

But in either case, the table_data model requires the list of valid rows
to be known *before* the table-specific handler is called.  That's a
fundamental design aspect of this particular helper.

You can actually load the column data from within the handler, but
at the very least - the helper needs to know the list of valid row indexes
beforehand.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Francois Bouchard
> Which framework are you using to build the MIB code?
the script used is mib2c.table_data.conf, opt 1) cache data is held
externally.

But I want to reload the data using xxx_Table_load() only in the handler,
so disabled the following:


// cache = netsnmp_cache_create(MPBCRMHOSUTABLE_TIMEOUT,
  mpbcRMHOSUTable_load,
mpbcRMHOSUTable_free,
  mpbcRMHOSUTable_oid,
mpbcRMHOSUTable_oid_len);

//  netsnmp_inject_handler(..)

... and added a global pointer (static netsnmp_tdata * Gtable_data) that is
passed to xxx_Table_load().

Hope it's clear.


Francois




2012/3/28 Dave Shield 

> On 28 March 2012 14:49, Francois Bouchard 
> wrote:
> > If empty, the xxx_Table_handler() is not called upon 'get' request from
> the
> > browser.  Unless doing a preload of that table in initialize_table_xxx()
> > function, is there a way to trig the handler at any 'get request'.
>
> Which framework are you using to build the MIB code?
> Most of the table frameworks will have a routine xxx_Table_handler()
> but they work somewhat differently internally.   It's difficult to answer
> this sort of query without knowing the details of exactly what you've
> got at the moment.
>
> Dave
>
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
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


Re: xxx_Table_handler() not being called if table is empty.

2012-03-28 Thread Dave Shield
On 28 March 2012 14:49, Francois Bouchard  wrote:
> If empty, the xxx_Table_handler() is not called upon 'get' request from the
> browser.  Unless doing a preload of that table in initialize_table_xxx()
> function, is there a way to trig the handler at any 'get request'.

Which framework are you using to build the MIB code?
Most of the table frameworks will have a routine xxx_Table_handler()
but they work somewhat differently internally.   It's difficult to answer
this sort of query without knowing the details of exactly what you've
got at the moment.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
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