Re: Need Help with my Table Iterator Sub-Agent

2023-01-06 Thread Ian C via Net-snmp-users
RESOLVED BY implementing make_data_context     iinfo->make_data_context = context_convert_function; . . .     void * context_convert_function( void *loop_context, netsnmp_iterator_info *iinfo )    {        Context_Data *datactx = SNMP_MALLOC_TYPEDEF(Context_Data);         if (!datactx)       

Need Help with my Table Iterator Sub-Agent

2023-01-05 Thread Ian C via Net-snmp-users
I have a sub-agent which I'm hoping will handle snmpwalk requests.  Presently what is happening is that my get_first_data_point() reads a file (a QNX PPS object to be specific), each line in the file represents on table row. Each line is json-formatted and gets parsed to the field level.  Rea

Help with Table Iterator Fetching Indexes

2011-07-20 Thread Mohammad Waqas Athar
I am extending agent using mib2c iterate configuration.I want to fetch the index so that i can query mysql database for example using command snmpget -v2c -c public localhost SL-MIB::TEMP0.\"lab01\" I want to fetch lab01 . But i cannot understand how _get_first_data_point and _get_next_data_p

Re: About net-snmp table iterator performance

2010-03-17 Thread bai haoquan
Hi, Thank you for your reply. Now I had known that the iterator helper is inefficient for large tables and I should try other helpers for my apps. And if the data requested is internal my agent, which kind of helper should I choose instead of the iterator helper. Looking forward to your reply. B

Re: About net-snmp table iterator performance

2010-03-17 Thread Dave Shield
On 17 March 2010 14:44, bai haoquan wrote: > And if the data requested is internal my agent, which kind of helper should > I choose instead of the iterator helper. Personally, I'd recommend the 'table_tdata' helper (as used by the 'mib2c.table_data.conf' template). Possibly in conjunction with th

Re: About net-snmp table iterator performance

2010-03-16 Thread Dave Shield
On 16 March 2010 09:10, Zhao Li H wrote: > We have our data stored in a AVL tree, that makes the search very quickly. > Is it ok to use raw table helper which is templated in mib2c.raw_table.conf? Of course you can. That does mean you'll have to do most of the processing from within your table h

RE: About net-snmp table iterator performance

2010-03-16 Thread Zhao Li H
Shield Sent: Monday, March 15, 2010 07:10 PM To: bai haoquan Cc: net-snmp-users@lists.sourceforge.net; Zhao Li H Subject: Re: About net-snmp table iterator performance On 15 March 2010 10:29, bai haoquan wrote: > To my understanding, it will cause performance problem when there are > mass o

Re: question about Re: About net-snmp table iterator performance

2010-03-15 Thread Dave Shield
On 15 March 2010 21:26, Kathy McLeod wrote: >> There is a flag that can improve performance if the internal >> indexing matches the SNMP ordering, but it's still probably >> not the most efficient of the helpers. > >  Where is the flag and when do I set it? netsnmp_iterator_info *iinfo =

question about Re: About net-snmp table iterator performance

2010-03-15 Thread Kathy McLeod
Hi - In your reply to note in title, you said: There is a flag that can improve performance if the internal indexing matches the SNMP ordering, but it's still probably not the most efficient of the helpers. Where is the flag and when do I set it? I have the iterate_access code working now so

Re: About net-snmp table iterator performance

2010-03-15 Thread Dave Shield
On 15 March 2010 10:29, bai haoquan wrote: > To my understanding, it will cause performance problem when there are mass > of data. Yes - the iterator helper is notoriously inefficient for large tables. It's probably not a sensible choice if performance is an issue. Use one of the other helpers i

Re: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-25 Thread Dave Shield
2009/6/25 김은영 : > Hmmm I wonder. > Try adding the option "-CB" to the snmptable - does that make a difference? > ==> > I've got the right results for all queries with "-CB" option! > Thank you very much! > > But, I'm still wondering why I've got wrong results when I queried without > "-CB"

RE: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-25 Thread 김은영
> snmpgetnext -v1 -c public localhost RADFINDER-MIB::rfcEngineAirIFType > snmpgetnext -v2c -c public localhost RADFINDER-MIB::rfcEngineAirIFType > snmpgetnext -v3 -u jupiter localhost RADFINDER-MIB::rfcEngineAirIFType > > RADFINDER-MIB::rfcEngineAirIFType.1 = INTEGER: WCDMA(30) >

Re: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-25 Thread Dave Shield
2009/6/25 김은영 : > snmpgetnext -v1 -c public localhost RADFINDER-MIB::rfcEngineAirIFType > snmpgetnext -v2c -c public localhost RADFINDER-MIB::rfcEngineAirIFType > snmpgetnext -v3 -u jupiter localhost RADFINDER-MIB::rfcEngineAirIFType > > RADFINDER-MIB::rfcEngineAirIFType.1 = INTE

RE: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-24 Thread 김은영
Hi... > What are the access control settings in your snmpd.conf file? > ==> > These are the part of the settings. > > com2sec private localhost private > rocommunity public > rwcommunity private > Urghh! No - don't mix "com2sec" and "r?community" direct

Re: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-24 Thread Dave Shield
2009/6/24 김은영 : > What are the access control settings in your snmpd.conf file? > ==> > These are the part of the settings. > > com2sec private localhost private > rocommunity public > rwcommunity private > Urghh! No - don't mix "com2sec" and "r?communi

RE: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-24 Thread 김은영
First of all, thank you for your rapid reply, Dave. > There are 3 tables in my MIB and I implemented the sub-agent to retrieve > these tables through the table iterator helper. (mib2c.iterate.conf) > > When I get the table via snmp v1, it works well. > > But if I try to get tho

Re: I don't know why the table iterator works well on snmp v1 but it doesn't work on snmp v2c or v3!

2009-06-24 Thread Dave Shield
2009/6/24 김은영 : > There are 3 tables in my MIB and I implemented the sub-agent to retrieve > these tables through the table iterator helper. (mib2c.iterate.conf) > > When I get the table via snmp v1, it works well. > > But if I try to get those via snmp v2c or v3, the val

Table Iterator Helper

2007-06-21 Thread Graeme Wilson
Hi, I have a couple of questions/problems with the iterator helper in my Agent code (I've been using Net-SNMP 5.3.0.1). Hopefully someone can help me out please. - I've been trying to use the "free_loop_context_at_end" function callback, but this only seems to get called when a simple "get" i

Table iterator problem

2007-01-17 Thread suresh khemka
Hi All, i am facing an issue regarding implementation of tables using mib2c.iterate.conf. i have created code using this config file. I have added my function to get data from kernel into a link list. I need to set up the my_loop_context and my_data_context to handle rows. The rows corresponds to

Re: Table iterator

2006-09-21 Thread Dave Shield
On 17/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: > So do the queries get serialized (one serviced at a time)? Mostly, yes. I believe that "delegated" GET* requests (including those passed on to subagents) can be processed in parallel. But any request handled by the main agent (and all SET

Re: Table iterator when index is sorted

2006-09-20 Thread Sachin Mishra
I didn't get any response for this, so I am resending just in case... Thanks, Sachin On Mon, 2006-09-18 at 12:12 +0530, Sachin Mishra wrote: > In my subagent I have data which is already sorted w.r.t. to index. > Should I use iterate.conf or array-user.conf to generate the subagent > template

Table iterator when index is sorted

2006-09-17 Thread Sachin Mishra
In my subagent I have data which is already sorted w.r.t. to index. Should I use iterate.conf or array-user.conf to generate the subagent template code. Is there anyu example of array-user.conf? The index for my table is OCTET-STRING. While using iterate.conf, if I specify the SORTED flag, it c

Re: Table iterator

2006-09-17 Thread Sebastian Bello
So do the queries get serialized (one serviced at a time)? Dave Shield escribió: On 13/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: Yet another question: does the iterator code get executed in multiple threads, that is, do I have to take care about mutual exclusion while acc

Re: Table iterator

2006-09-14 Thread Dave Shield
On 13/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: > Yet another question: does the iterator code get executed in multiple > threads, that is, do I have to take care about mutual exclusion while > accessing data structures for example? The Net-SNMP agent isw not (currently) capable of multi-

Re: Table iterator

2006-09-13 Thread Sebastian Bello
Yet another question: does the iterator code get executed in multiple threads, that is, do I have to take care about mutual exclusion while accessing data structures for example?     Sebastian- Sebastian Bello escribió: Sorry, I apologize to all, my fault! A bug in my code! :( Thanks for t

Re: Table iterator

2006-09-11 Thread Sebastian Bello
Sorry, I apologize to all, my fault! A bug in my code! :( Thanks for the assistance!     Sebastian- Dave Shield escribió: On 11/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: Returning NULL isn't working for me; even the following code crashes snmpd (it shouldn't, right?):

Re: Table iterator

2006-09-11 Thread Dave Shield
On 11/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: > > Returning NULL isn't working for me; even the following code crashes snmpd > (it shouldn't, right?): It shouldn't - no. Try running the agent under a debugger, and see where it falls over. > netsnmp_variable_list *moTable_get_first_da

Re: Table iterator

2006-09-11 Thread Sebastian Bello
Returning NULL isn't working for me; even the following code crashes snmpd (it shouldn't, right?): netsnmp_variable_list *moTable_get_first_data_point(void **my_loop_context, void **my_data_context,   netsnmp_variable_list *put_index_data,   nets

Re: Table iterator

2006-09-11 Thread Dave Shield
On 11/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: > In the "End of table" code portion, how should the function return NULL. Dave - Using Tomcat but need to do more? Need to support web services, security? Get stuff d

Re: Table iterator

2006-09-11 Thread Sebastian Bello
An additional question. Consider the following code: netsnmp_variable_list *moTable_get_next_data_point(void **my_loop_context, void **my_data_context, netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata) {     netsnmp_variable

Re: Table iterator

2006-09-08 Thread Sebastian Bello
Thanks Dave! Dave Shield escribió: > On 07/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: >> 1- the data from the MIB table will be collected periodically from other >> processes, and be probably cached for some time; is table_iterator the >> right choice? > > It can certainly be used that way.

Re: Table iterator

2006-09-08 Thread Dave Shield
On 07/09/06, Sebastian Bello <[EMAIL PROTECTED]> wrote: > 1- the data from the MIB table will be collected periodically from other > processes, and be probably cached for some time; is table_iterator the > right choice? It can certainly be used that way. mib2c -S cache=1 -c mib2c.iterator.con

Re: Table iterator

2006-09-08 Thread Sebastian Bello
Any hint on this? Sebastian Bello escribió: > Hi all, > > I'm trying to implement a table using mib2c with 'mib2c.iterate.conf'. > I read the doc from 'table_iterator.c' but still have some questions: > > 1- the data from the MIB table will be collected periodically from other > processes, and be

Table iterator

2006-09-06 Thread Sebastian Bello
Hi all, I'm trying to implement a table using mib2c with 'mib2c.iterate.conf'. I read the doc from 'table_iterator.c' but still have some questions: 1- the data from the MIB table will be collected periodically from other processes, and be probably cached for some time; is table_iterator the ri

RE: shared table and table iterator

2006-02-02 Thread Keller, Beat
Dear Dave, thanks for your answer. > How does each subagent decide which rows they will support? The subagent asks with register_int_index() the masteragent for its index. > Can rows be created dynamically - if so, how? No. > You won't be able to register the whole table in the usual manner. >

Re: shared table and table iterator

2006-02-01 Thread Dave Shield
On Wed, 2006-02-01 at 17:46 +0100, Keller, Beat wrote: > We are using net-snmp 5.3.0.1 and have a shared table within different > subagents ... Is it possible to solve this problem with the > table_iterator? It should be possible to implement this using the table_iterator (though it might

shared table and table iterator

2006-02-01 Thread Keller, Beat
Hi, We are using net-snmp 5.3.0.1 and have a shared table within different subagents (e.g. Subagent 1 has row with index = 1, Subagent 2 has row with index = 2, etc...). Is it possible to solve this problem with the table_iterator? We always get the problem with duplicated registering. Thanks fo

Help required for table iterator

2005-11-08 Thread shree.kant
Title: Help required for table iterator Hi All, I am new to net-snmp. I generated code using mib2c.iterate.conf for adslMIB. In create entry I am hardcoding the node value(for testing purpose only.) The problem is that  1. It is retriving first row only. and i am facing problem in the

Re: Table Iterator architecture question

2005-08-15 Thread Mike Varley
Thanks for the response Robert! MV Robert Story wrote: On Tue, 09 Aug 2005 14:30:20 -0400 Mike wrote: MV> That is, for every iteration through the table rows, the entire row is MV> copied into the agent using snmp_set_var_value; and the entire table is MV> iterated over before the 'handler' m

Re: Table Iterator architecture question

2005-08-12 Thread Robert Story
On Tue, 09 Aug 2005 14:30:20 -0400 Mike wrote: MV> That is, for every iteration through the table rows, the entire row is MV> copied into the agent using snmp_set_var_value; and the entire table is MV> iterated over before the 'handler' method is called and the requested MV> variable is returned

Table Iterator architecture question

2005-08-09 Thread Mike Varley
Hello there, (we are migrating from UCD to NET-SNMP and have some implemetation questions) I was looking at the behaviour of the MibII/tcpTable module in the source code, using it to try and understand the table-iterator pattern used in the new Net-SNMP API. What I found was, everytime a

Re: Questions: building MIB agent using table iterator helpers

2005-03-08 Thread Robert Story
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 r

RE: Questions to the table iterator helpers

2005-03-05 Thread William R. Buckley
@lists.sourceforge.net Subject: Questions to the table iterator helpers I have seen a question asking more detailed explanation on the table iterate helpers posted on Wednesday March 02 with the title "Questions: building MIB agent using table iterator helpers (Chuck Cottrill)". I

Questions to the table iterator helpers

2005-03-05 Thread Rachel Wang
I have seen a question asking more detailed explanation on the table iterate helpers posted on Wednesday March 02 with the title “Questions: building MIB agent using table iterator helpers (Chuck Cottrill)”. I am having similar problems and questions with net-snmp 5.0.9. Looking forward to

Questions: building MIB agent using table iterator helpers

2005-03-02 Thread Chuck Cottrill
I am using Net-snmp 5.0.8 on redhat Enterprise WS 3 (2.4 kernel). I want my agent implemented as a separate agentX subagent. I built an agent that provides access to my MIB, which contains Read-Only tables. I get responses to my snmpwalk, so I have everything connected and functioning. I am imple

Re: Table iterator: get_next_data_point

2004-07-09 Thread Wes Hardaker
> On Wed, 7 Jul 2004 18:28:45 +0100, <[EMAIL PROTECTED]> said: holger> Unfortunately my table could return far more than 120 rows and holger> I am afraid this n-squared behaviour will bring my processor holger> to it's knees. Well, I guess I just have to live with it. 1) make sure you are usi

RE: Table iterator: get_next_data_point

2004-07-09 Thread holger.klaas
> From: Dave Shield > Sent: 09 July 2004 09:38 > > The data I am accessing is in a shared memory area. It is > > already ordered but might have gaps in it (ie. some rows > > might be missing). > > The gaps are no problem, but the iterator helper doesn't > assume that the list is sorted properl

Re: Table iterator: get_next_data_point

2004-07-09 Thread Dave Shield
> The data I am accessing is in a shared memory area. It is already ordered > but might have gaps in it (ie. some rows might be missing). The gaps are no problem, but the iterator helper doesn't assume that the list is sorted properly, so will look through the whole thing for each individual reque

Re: Table iterator: get_next_data_point

2004-07-08 Thread Users
On Thu, 8 Jul 2004 08:48:37 +0100 [EMAIL PROTECTED] wrote: HKC> > If you don't mind caching, then the stash cache helper would help. HKC> > There a lots of different ways of optimizing, using various HKC> > different handlers HKC> > and helpers. It just depends on your data, and how much extra HK

RE: Table iterator: get_next_data_point

2004-07-08 Thread holger.klaas
> From: Robert Story (Users) > Sent: 08 July 2004 01:25 > > On Wed, 7 Jul 2004 18:28:45 +0100 holger wrote: > HKC> > I have coded my own MIB module based on a stub file that was > HKC> > originally auto-generated by mib2c using mib2c.iterate.conf,v > HKC> > 5.5. The module contains a table with

Re: Table iterator: get_next_data_point

2004-07-07 Thread Users
On Wed, 7 Jul 2004 18:28:45 +0100 [EMAIL PROTECTED] wrote: HKC> > I have coded my own MIB module based on a stub file that was HKC> > originally auto-generated by mib2c using mib2c.iterate.conf,v HKC> > 5.5. The module contains a table with 7 columns and currently HKC> > 120 rows. [...] I was qu

RE: Table iterator: get_next_data_point

2004-07-07 Thread holger.klaas
> From: Holger > Sent: 06 July 2004 21:31 > I have coded my own MIB module based on a stub file that was > originally auto-generated by mib2c using mib2c.iterate.conf,v > 5.5. The module contains a table with 7 columns and currently > 120 rows. The first 3 columns are table indexes and defined

Table iterator: get_next_data_point

2004-07-06 Thread holger.klaas
Hi, I have coded my own MIB module based on a stub file that was originally auto-generated by mib2c using mib2c.iterate.conf,v 5.5. The module contains a table with 7 columns and currently 120 rows. The first 3 columns are table indexes and defined as not-accessible. The table seems to be worki