RE: table.c helper return code

"Pamidipati Suresh-G20238" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi All,

We are using Net-snmp-5.2.2 as Agentx Subagent and master agent.
For a get-next request on a table having no rows, we are returning
SNMP_ERR_NOERROR to the library, as suggested by Rob in the mail below.
This is working fine and subagent moves to the next table to issue the
get-next request.

But we noticed a problem if there are lot of tables in sequence which
don't have rows in them, and a get-next is issued on the first table.
Following is the description of the same.

We have 600 tables in lexicographical order in the MIBs owned by
subagent and don't have rows populated in them. Table-601 has rows in
it. We gave snmp get-next on Table1 OID.
SNMPD has sent the Agentx get-next request to Subagent on the Table1 OID
with END OID scoped to Table2 OID.
Subagent called the Table1 handler function. As there are no rows in the
table, it returned SNMP_ERR_NOERROR to the library and this caused
Subagent to call the Table2 handler. Subagent called all the Table
handlers in the sequence and table-601 handler gave the response. Now
Subagent, checked that Table-601 OID is not in the scope of END Table2
OID in the request and returned SNMP_ENDOFMIBVIEW to SNMPD.

SNMPD has sent another get-next request to subagent on Table2 OID with
END OID scoped to Table3 OID. Subagent again called all the table
handlers (for tables 2 to 601) and then returned SNMP_ENDOFMIBVIEW to
SNMPD.
Like this for the given single SNMP GET-NEXT request, SNMPD has sent
Agentx get-next requests one after other on each table OID (from Table1
to Table-601) and for each of these requests, subagent has traversed
through all the tables to return the response.

This resulted in increase in CPU usage of Subagent up to 55%. Now, my
question is that is there a way to avoid the Subagent loop through all
the tables for each request, as SNMPD anyway sending the Agentx get-next
requests for all the tables. 

Please let me know if there is any error code, instead of
SNMP_ERR_NOERROR, that subagent can return to the library for get-next
requests on tables having no rows, which avoids this loop of all the
tables at Subagent.

I have tried by returning SNMP_ERR_GENERR, but this resulted in general
failure received as the response for the SNMP get-next request.

Any information on this will be really helpful.

Thanks & Regards,
Suresh.






-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Kurapati M-G19456
Sent: Wednesday, November 30, 2005 12:48 PM
To: [email protected]
Subject: RE: table.c helper return code


Rob, 

We were retuning GEN_ERR.  After making the necessary changes as per
your mail, I could see that GETNEXT is working properly.  Thank you for
your timely help!!

Thanks
Mahesh 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert
Story
Sent: Tuesday, November 29, 2005 11:36 PM
To: Kurapati M-G19456
Cc: [email protected]
Subject: Re: table.c helper return code

On Tue, 29 Nov 2005 00:26:52 +0800 Kurapati wrote:
KMG> What error should the subagent return in a GETNEXT response on a
KMG> table with no rows in it? Should it be GENERR, or NO_OBJECT, or 
KMG> NO_SUCHINSTANE?  We are using table.c helper functions in the
SubAgent.

It should return no error, but set no object values. The subagent should
then move on to the next table.

--

-----Original Message-----

Hi all, 
 
we are using NET-SNMP-5.2.1.2 in Agentx mode.  
 
What error should the subagent return in a GETNEXT response on a table
with no rows in it? Should it be GENERR, or NO_OBJECT, or
NO_SUCHINSTANE?  We are using table.c helper functions in the SubAgent. 
 
Your clarifications will be greatly appreciated.  
 
Thanks
Mahesh

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.