On Wed, 2 Mar 2005 22:38:51 -0500 Chuck wrote: CC> I am using Net-snmp 5.0.8 on redhat Enterprise WS 3 (2.4 kernel). CC> I want my agent implemented as a separate agentX subagent.
I'd recommend upgrading to at least 5.1.2 if you are using AgentX. Or at least 5.0.9, which is the most recent 5.0.x release. CC> I am implementing a MIB that defines two tables. [...] I have implemented CC> the guts to the callback functions generated by mib2c, using configuration CC> file"mib2c.iterate.conf". CC> CC> I have several questions as I am trying to better understand how the CC> arguments to these callback functions should be handled. CC> CC> 1. How do I interpret the arguments to the get_first callback so that I CC> know whether this is truly a call for the first row of the table, or a call CC> for the first row, but second (third, etc) column? You can't. The get_*_datapoint routines are only concerned with finding indexes, not columns. CC> I observe that the SessionTable_get_first_data_point function is called CC> many times. In what context? during a snmpwalk? a snmpget? In general, it will be called once per request. CC> I have read that this function is supposed to be called for CC> the first row, and the SessionTable_get_next_data_point function should CC> provide values for each of the rows. Neither routine provides values, they provide the indexes. Values are not dealt with until the handler is called. CC> It appears that the get_first function is being called for each column of CC> the table. For a single request it shouldn't. However, that's in recent releases. I do seem to recall some efficiency improvements being made to the iterator stuff, but that was a while ago. You might want to try testing 5.1.2 and seeing if you get the same results. CC> 2. When should the SessionTable_handler function be called? And how do I CC> interpret the arguments to this function? It will be called once the get_*_datapoint routines have found the right row for a request. In general, you only need to deal with the requests parameter, to provide values for each request varbind. CC> I had expected that the SessionTable_handler function would be called to CC> provide data for each column. It appears to be called once for each CC> column, and my implementation does determine which column should be CC> processed. But it appears that this handler function is able to process CC> several columns iteratively, and it seems to only process one column for CC> each call. Again, without knowing what type of request you are processing, or how many varbinds it has, it's hard to say. CC> 3. Could someone tell me how to print out the OID I am working with in the CC> _get_first, _get_next, or _handler functions? The get routines don't know anything about the OID in the request. They only need to set the indexes for every row in the table. In the handler, the example code should extract the table info, which will tell you what column you are dealing with. It also has the OID of the incoming request. For a get/set, that is the same as the OID of the row. For a get-next, it is not, and there is no way to get it from the api. But you have the data context you set in the get routines, so you should be able to figure it out the same way you did in the get routines. CC> 4. How do I know which row of the table a particular GET has requested? CC> Is that part of the arguments to _get_first (and _get_next)? Again, the get routines don't deal with the particulars of a request. CC> 5. I understand that the callback functions are called the GET(SET) for CC> the associated OID is received. I can't parse that sentence. CC> 6. Have I done something wrong if the table callback functions are getting CC> called many times? The table processing seems to call an awful lot of CC> functions to get very little data. Probably not. The iterator stuff is inefficient. particularly older versions, before the optimization changes were made. -- Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- 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