I'm trying to setup a table that will have two columns:
* Name - name of a certain item I need to model
* Status - Enumerated Status of the item ( green(1), yellow(2),
red(3) ....)
The table will have multiple rows
The number of rows and status will change over time (typically it should
be fairly static but with device configuration it will change)
The data is gathered by other infrastructure and can be fed to the agent
with a handler method upon request.
I've found the following tutorial:
http://www.net-snmp.org/dev/agent/data__set_8c-example.html
That tells me how to build the table originally however assuming that I
register a handler I'm not certain as to how I update this table.
I have seen other examples where in the handler you do something like
the following:
netsnmp_table_request_info *tableInfoPtr;
tableInfoPtr = netsnmp_extract_table_info(request);
switch ( tableInfoPtr->colnum){
case 1:
....
snmp_set_var_typed_value(.....)
case 2:
....
}
Where each of the case statements would set a single column in a given
row. But this seems best suited where a table only has a single row.
But it isn't clear to me how you could use this model with multiple
rows. What I really want to do is just re-populate the entire table
each time any of the contents are requested to ensure the entire table
is up to date.
Just as a disclaimer I'm new to snmp so please let me know if something
I'm asking here doesn't make sense in the context of SNMP.
Do I need to keep a reference to the netsnmp_table_data_set and then
just update the entire table each time the handler is called? Is there
any tutorial or sample code that shows how to handle a table with
multiple rows where the number of rows can change over time?
Thanks,
Jared
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
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