hai, > M> > M> If [the response] has not come, i set "SNMP_ERR_NOSUCHNAME" to > M> > M> requests->status and unmark the request as delegated. But i get > another > M> > M> > M> > M> request for the next registered mib tree. > M> > M> [...] > M> > M> when i don't delegate the request but still set "SNMP_ERR_NOSUCHNAME", > M> > M> the agent returns no such instance and doesn't generate another > request > M> > M> for the next registered mib tree. Why is this inconsistent? I am using > M> > M> table handler in net-snmp version 5.1. > M> > > M> > What kind of request is this? A get, or a getnext (walk)? > M> > M> This is a getnext request mostly part of a walk. > > If no instance is found by a handler, the agent should move on to the next > row, > column or handler. This is actually not an error case, so you shouldn't set an > error at all. simply return without processing the variable. >
Accepted. But see below for why i do like this. > M> I have registered a handler for a set of oids(tables). When any request > M> for any of them come, i check whether the required data is available in > M> local cache that i maintain using my own data structures. If it is > available > M> i use them. For some specific columns i explicitly set > "SNMP_ERR_NOSUCHNAME" > M> since the other process doesn't currently support them. > > Two things. First, you can set up the valid_columns structure of the table > handler, and you will not get called for those columns. Second, the correct > error is SNMP_ERR_NOSUCHOBJECT. This should result in your handler being > called > again for the next column. > I will hereafter use SNMP_ERR_NOSUCHOBJECT. > M> Else i sent the > M> request to the other process using sockets and delegate it. In the alarm > M> callback function if the data is not yet received i set the error > M> "SNMP_ERR_NOSUCHNAME" and unmark as delegated. > > Again, lack of data is not an error. Simply return so that the agent can move > on to the next table. > > M> Also i would like to add one more thing. Since the communication to the > M> other process takes time and most of the walks are for columns, i tried > M> setting explicitly "SNMP_ERR_NOSUCHNAME" after the column ends so that no > M> request is generated for the next column. This works if don't delegate the > M> request. If i delegate and then later set this error, it generates new > M> request for the next mib tree(table). Even though this is not complying > M> with SNMP is this achievable? > > I don't understand what you are trying to achieve. If communication time is > the > problem, you are better off caching, instead of not following the protocol > rules. > I know that i will get queries for only certain columns which will be always walks. At the end of the walk even though next column values can be obtained through remote communication, i want to avoid this due to the time taken. Same case with requests for which responses are not received within a certain time. Anyway the manager would have timed out and so i don't want to have another request given by the agent for the next mibtree. > M> I am using table handler directly without using mib2c. I want to use > M> SNMPv3 contexts. Since data is external, i have to use iterator helper. > > That's not necessarily true. With a little work you can use caching > to work with array-user. If you upgrade to 5.2.1, you can use the new mfd > helper too. > Can i get some documentation and examples for mfd helper? Does it support contexts and delegation? > M> But since the get_first and get_next data point functions don't support > M> contexts i couldn't use them. > > They don't, but you can fake it. simply register each table with a unique > get_first and get_next routine, and those unique routines identify the > context, > and can then call more generic routines to do the work. > But in our case new contexts will get added during run time for which also i will use the same remote communication to get data. So, i want one set of methods to take care of all contexts. ------------------------------------------------------- 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-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
