On 07/05/07, Senthil Nathan wrote:
> I have an general query,
> In SNMP MIB table ,the indexing is dynamic?

What exactly do you mean by that?

The style of indexing (how many index values, and what type - single
integer, multi-dimensional, strings, etc) is fixed, and defined by the MIB file.

The values of those indexes - i.e. what rows are valid - is dynamic.
As the underlying subsystem changes (processes are started or stopped,
network connections made or broken, etc), the corresponding rows will
appear or disappear in the MIB table.

> presently i am using mib2c iterator config,net-snmp style of code. I have
> followed the position count as loop context.I have made the index as fixed.
> is it possible for dynamic ?

Yes. (See above).
Your get_{first,next} hook routines should report the situation for the data
as it stands at the time the request arrives. A subsequent request may
well work with a different list of rows, depending on the underlying data.

> Secondly, when i make the Get-bulk or walk,the snmp agent( values supplied
> by external to the system ) made the request on next table,In our
> application its little bit time consuming , we need to avoid that.

You can't - it's inherent in how SNMP works.
The management client doesn't typically know how many rows there are
in a MIB table, All it can do is keep walking the table, until it walks off
the end.

If there's a MIB object to report the number of objects in the MIB table,
then you could use this information to set the number of repetitions in
a GetBulk request (or control the number of GetNext requests to send
when walking the table).

But the basic walk commands just keep going until they spot that they've
moved on to another table.


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Net-snmp-coders mailing list