--- Dave Shield <[EMAIL PROTECTED]> wrote:
> On Wed, 2005-06-15 at 19:12, Steve S. Law wrote: > > > > How do the iterator 'get_{first,next}' hook > routines > > > obtain the list of entries to work with? > > > Do you have an internal list, or something > similar? > > > How is this generated? > > > Iterator routines are generated by mib2c tool. > There > > is a global pointer to the list - > > struct applTable_entry *applTable_head , which is > a > > linked list, also generated by mib2c > > Yes - mib2c generated the framework of the module > implementation, including the code to look through > a linked list. > > But how is this list populated? > Are you monitoring some underlying system, or is > this > module purely internal to the SNMP agent? sub-agent is monitoring some external application processes. For each process being monitored, there will be a row in the table. Whenever snmpget command is made, sub-agent will send the request in a format that is understood by monitored process. The monitored process then returns the value of the requested columnar object to the sub-agent. The data only exists in external processes. Sub-agent simply gathers information and populates the MIB table. When external processes start up, they register with sub-agent by sending a message containing a row ID and PID which together form an index of the table. Sub-agent then creates the rows for those processes by calling applTable_createEntry function in a loop. If there are 10 external processes started up, then the MIB will have 10 rows, but their columns will have no value yet (either zero or NULL) because no SNMP get request has been issued yet. > > What does an individual row of the table represent? > > > > > For my situation, I just need to write/implement a > new > > function applTable_removeEntry which will look for > the > > entry and delete it from the linked list. Correct? > > Not necessarily, no. > The MIB data doesn't exist in isolation - it's the > SNMP > representation of some external subsystem. When one > of > these external "things" disappears, then the > corresponding > row in the table should be removed. Conversely, > when > a row is deleted from the table, it should have a > knock-on > effect on the relevant external "thing". I want to delete the row when that external process dies. One of the variables I monitor is applOperStatus. If a process is dead and someone tries to query the process, there will be time out error and sub-agent will return applOperStatus as "down" for that process. Now I want to delete the row. I should , shouldn't I? and my question is the way to implement is just find the row corresponding to the process in the list and if found, remove it from the list. All this needs to be coded by myself of course? > > That's why I'm asking about this link. How you > build > the linked list will affect how to handle deletions. > > Dave > > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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