Let me explain more details on what I was doing and what I think was
happening. I created an iquery session for calling netsnmp_query_get(). The
iquery session has fd=5. When I query for local objects registered by the
master agent, everything works fine. But when I query for delegated object,
the master agent will create a delegated session fd=10 to get subagent
response. It seems the delegated session's request is satisfied and fd=10
is cleared. But iquery session fd=5 is still waiting for a response in an
infinite loop.

I don't know what needs to be done after delegated session receiving the
response and how to pass that response to the iquery session fd=5 so that
it can be cleared as well. I couldn't find an example handling delegated
session with iquery session. If there is such case in Net-SNMP, please let
me know. But I am afraid I am looking for piece of code that may not exist.
If this feature is not supported yet, I am willing to implement it to make
it work. Just advice what needs to be done, please. It is also possible
that I missed some setup for iquery session to work with delegated session,
such as iquery_session->callback, what the callback should be then?

I appreciate any helps on this, because I am really stuck =).
Emi Yanagi

----- Forwarded by Emi Yanagi/Radisys_Corporation/US on 04/27/2007 03:46 PM
-----

Emi
Yanagi/Radisys_Co
rporation/US To
net-snmp-coders@lists.sourceforge.n
04/18/2007 04:45 et
PM cc

Subject
Internal query fails to get
delegated object's value









Dave,

I reproduced the same problem that internal query for a delegated object
returns (-2), by using netsnmp_query_get and internal query session. It
works perfectly fine when query for objects registered in the master agent
though.

I collected and analyzed lots of debug messages and found out the problem
happens after agentx_got_response(). When handling an internal query, after
agentx_got_response(), it gets into a dead lock in select loop, and never
reached to netsnmp_check_outstanding_agent_requests() to finish the
processing of the delegated request.

snmp_agent: agent_sesion 0x100df478 created
verbose:asp: asp 0x100df478 reqinfo 0x1021a1b8 created
snmp_agent: add_vb_to_cache(0x100df478, 1, IF-MIB::ifOutOctets.1034,
0x101ef040)
snmp_agent: tp->start IF-MIB::ifOutOctets.1034, tp->end
IF-MIB::ifOutOctets.1035,
verbose:asp: asp 0x100df478 reqinfo 0x1021a1b8 assigned to request
verbose:asp: asp 0x100df478 reqinfo 0x1021a1b8 assigned to request
agentx/master: agentx master handler starting, mode = 0xa0
agentx/master: request for variable (IF-MIB::ifOutOctets.1034)
snmp_agent: delegate session == 0x100df478
snmp_agent: end of handle_snmp_packet, asp = 0x100df478
sess_select: for all sessions: 10 (to in 1176926260.858204 sec) 9 8 5
(to in 1176926260.85
6783 sec) 6 3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)
sess_select: for all sessions: 10 (to in 1176926260.858204 sec) 9 8 5
(to in 1176926260.85
6783 sec) 6 3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)
sess_select: for all sessions: 10 (to in 1176926260.858204 sec) 9 8 5
(to in 1176926260.85
6783 sec) 6 3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)
sess_read: loop packet_len 64, PDU length 64
sess_process_packet: session 0x100e2470 fd 10 pkt 0x10132a58 length 64
agentx/master: got response errstat=0, (req=0x4,trans=0x0,sess=0x7)
agentx/master: agentx_got_response() beginning...
agentx/master: handle_agentx_response: processing:
IF-MIB::ifOutOctets.1034
agentx/master: handle_agentx_response() finishing...
sess_read: not reading 9 (fdset 0x7fda9630 set 0)
sess_read: not reading 8 (fdset 0x7fda9630 set 0)
sess_read: not reading 5 (fdset 0x7fda9630 set 0)
sess_read: not reading 6 (fdset 0x7fda9630 set 0)
sess_read: not reading 3 (fdset 0x7fda9630 set 0)
sess_select: for all sessions: 10 9 8 5 (to in 1176926260.856783 sec) 6
3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)
sess_select: for all sessions: 10 9 8 5 (to in 1176926260.856783 sec) 6
3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)
sess_select: for all sessions: 10 9 8 5 (to in 1176926260.856783 sec) 6
3
sess_select: next alarm 0.1 sec
verbose:sess_select: timer due *real* soon. 1 usec
verbose:sess_select: setting timer to 0.1 sec, clear block (was 1)

This is as far as I could find by turning on debug tokens, session 5 is the
internal query which never gets the response.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders