After dig into this problem deeper, it looks to me that internal query
session's callback_magic is NULL, thus handle_snmp_packet() will create a
delegated session (fd=10) to get the subagent response.  The internal query
session(fd=5) then is waiting for the subagent response forever.

If the analysis is correct, the resolution then is to set internal query
session's callback_magic correctly, so the delegated session pointing to
the internal session's callback_magic. Does it make sense?
How to set callback_magic to do this in a right way?

Thanks for your support.
Emi Yanagi



                                                                           
             Emi                                                           
             Yanagi/Radisys_Co                                             
             rporation/US                                               To 
                                       [EMAIL PROTECTED] 
             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.

On the other hand, an external query works just fine, after
agentx_got_response(),netsnmp_check_outstanding_agent_requests() is called
and it processing the delegated request successfully. See the log below:

   snmp_agent: agent_sesion 0x102195e0 created
   verbose:asp: asp 0x102195e0 reqinfo 0x100e0a50 created
   snmp_agent: add_vb_to_cache(0x102195e0, 1, IF-MIB::ifOutOctets.1033,
   0x101e3bc8)
   snmp_agent: tp->start IF-MIB::ifOutOctets.1033, tp->end
   IF-MIB::ifOutOctets.1034,
   verbose:asp: asp 0x102195e0 reqinfo 0x100e0a50 assigned to request
   verbose:asp: asp 0x102195e0 reqinfo 0x100e0a50 assigned to request
   agentx/master: agentx master handler starting, mode = 0xa0
   agentx/master: request for variable (IF-MIB::ifOutOctets.1033)
   snmp_agent: delegate session == 0x102195e0
   snmp_agent: end of handle_snmp_packet, asp = 0x102195e0
   sess_read: not reading 8 (fdset 0x7fa32860 set 0)
   sess_read: not reading 5 (fdset 0x7fa32860 set 0)
   sess_read: not reading 6 (fdset 0x7fa32860 set 0)
   sess_read: not reading 3 (fdset 0x7fa32860 set 0)
   snmp_agent: netsnmp_check_outstanding_agent_requests asp = 0x102195e0
   sess_select: for all sessions: 10 (to in 1176921584.211791 sec) 9 8 5 6
   3
   sess_select: next alarm 0.552604 sec
   verbose:sess_select: timer due *real* soon. 552604 usec
   verbose:sess_select: setting timer to 0.552604 sec, clear block (was 0)
   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=0x2,trans=0x1,sess=0x7)
   agentx/master: agentx_got_response() beginning...
   agentx/master:   handle_agentx_response: processing:
   IF-MIB::ifOutOctets.1033
   agentx/master: handle_agentx_response() finishing...
   sess_read: not reading 9 (fdset 0x7fa32860 set 0)
   sess_read: not reading 8 (fdset 0x7fa32860 set 0)
   sess_read: not reading 5 (fdset 0x7fa32860 set 0)
   sess_read: not reading 6 (fdset 0x7fa32860 set 0)
   sess_read: not reading 3 (fdset 0x7fa32860 set 0)
   snmp_agent: netsnmp_check_outstanding_agent_requests asp = 0x102195e0
   snmp_agent: processing delegated request, asp = 0x102195e0
   snmp_agent: REMOVE session == 0x102195e0
   snmp_agent: agent_session 0x102195e0 released
   verbose:asp: asp 0x102195e0 reqinfo 0x100e0a50 freed
   sess_select: for all sessions: 10 9 8 5 6 3
   sess_select: next alarm 0.533115 sec
   verbose:sess_select: timer due *real* soon. 533115 usec
   verbose:sess_select: setting timer to 0.533115 sec, clear block (was 0)

I would like to continue debugging this problem but I need your help. I
would appreciate any insight or advice on how to solve this problem.

Thanks for your support.

Emi Yanagi
                                                                            
 Re: DisMan Event MIB Problem                                               
 From: Dave Shield <[EMAIL PROTECTED]> - 2007-03-02 22:44                      
                                                                            
 On 02/03/07, Uday Sorte <[EMAIL PROTECTED]> wrote:                             
   
 > I tried with the master agent object sysServices and it is working fine. 
 > Means I have problems with the subagent and not with the snmpd.conf file 
 > or anything else.                                                        
 >                                                                          
 > What could be the possibility. My subagent is not linked properly with   
 the                                                                        
 > whole MIB tree, but then why snmpget and snmpset works properly.         
                                                                            
 OK - I've managed to reproduce the problem using the                       
 latest development code. It definitely looks as if there is                
 some incompatability between AgentX processing and                         
 the handling of internal DisMan monitor requests.                          
                                                                            
 It might take me a little while to unpick exactly what's                   
 going on, and then to come up with a fix. I'll report back                 
 when I know a bit more.                                                    
                                                                            
 Dave                                                                       
                                                                            





-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to