Thanks Dave. I got  almost all the doubt answered.
Yes, the table is indexed by an integer - in this case the moduleId is the 
index. 
However it can be any integer number set up by user. These number (moduleId) 
can be read by agent from a text file.
According to the example at the init time the agent can read this text file and 
store all the moduleId in a memory.

What I'm not clear  is how the var_xxxtable() return each instance to correlate 
to the data previous read? 
i.e How the agent correlates the array element to each instance? Said 
.1.3.6.1.4.1..........moduleId.0 =100, .1.3.6.1.4.1....moduleId.1=101, 
.1.3.6.1.4.1....moduelId.2 = 300 
Does this handled by the header_simple_table()? 

Thanks,
Jim


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dave Shield
Sent: Wednesday, April 06, 2005 6:07 PM
To: Jim Su
Cc: Net-Snmp-Users
Subject: Re: iteration of entry in table

On Sun, 2005-04-03 at 14:00, Jim Su wrote:
>  I simply want the agent to "list" all the configured modules

Nope - that's not how the agent works.
The agent is asked for a particular value - either "give me this
value" or "give me the next value after this".   It's the *client*
side (snmpwalk) that uses this to list the configured modules,
by sending a sequence of requests.

  The agent treats each request completely independently.

>  Will a header_simple_table routine sufficient enough to handle
> the iteration?

That depends on the definition of your MIB.
If it's a simple integer-indexed array (1-N), then yes.


>  If the header_simple_table routine is sufficient I assume
>  the MAX_VALID_INDEX is to be set to the total possible number
>  of moduleId?

Yes.  Quite correct.


>  I think what I am not clear about is how all the rows of data
>  in the table are returned? Each time the var_table() returns one
>  value and goes on the next oid, isn't it?

No - each time, the var_table() routine returns one value.
End of story (as far as the agent is concerned).

It's *snmpwalk* that goes on to the next OID.


> How do I "list" them (the same oid but different instance)

header_simple_table() will handle most of this for you.
Call that routine, extract the index value from the OID
(i.e. the last entry in the 'name' array), and the return
the requested value (vp->magic) from that particular row.


Dave



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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 
HW夸)b粗h?+y羕N??v??y?'z汻jwbv楝?,│n?煡?!3諢?傳諲j溣[津??(赭?'!死嘈l飩瓜X砧瘱J^?^J眱須?)??嗓?l〥gr?i?

Reply via email to