Hi Kuldeep, Thank you. Unfortunately, I didnot capture packets, but there was engineID missing on SNMP manager during the test. I fixed that and noticed no snmpinforms then. So checked at snmp-agent side and noticed that snmptrap is stuck. Does 'snmptrap' not timeout if there is no engineID in response from SNMP-manager?
*System details:* net-snmp : 5.7.1 Kernel : 4.1.22-ltsi machine : arm OS : linux Thank you, Pushpa.T On Mon, Jun 19, 2023 at 3:54 PM Kuldeep Patidar <kuldeepatida...@gmail.com> wrote: > Hello pushpa .. > > Thank you for providing the additional information. From the given > details, it seems that the issue is occurring within the `main()` function > of the `snmptrap.c` file. > > Based on the provided local variables, it appears that the SNMP session is > configured correctly, including the SNMP version, community string, and > security parameters. The session has the correct peername set to > "192.168.18.69," indicating that the destination IP is reachable. > > Since the manager IP being unreachable results in a timeout, it is > possible that there is a network connectivity issue or a problem with the > SNMP server configuration. However, since you have confirmed that the IP is > reachable, we can explore other potential causes. > > Here are a few suggestions to further investigate the issue: > > 1. Verify the response from the SNMP server: Check the SNMP server logs or > enable debugging on the server side to see if it is receiving the SNMP > inform request and generating a response. This can help determine if the > issue lies with the server's handling of the inform requests. > > 2. Capture network traffic: Use network monitoring tools (e.g., Wireshark) > to capture the network traffic between the device running the `snmptrap` > command and the SNMP server. Analyze the captured packets to ensure that > the inform request is being sent correctly and that the server is > responding. > > 3. Check for firewall or security restrictions: Ensure that there are no > firewall rules or security restrictions on either the device running the > `snmptrap` command or the SNMP server that might be blocking or interfering > with the SNMP inform packets. > > 4. Monitor system resources: Monitor the system resources (CPU, memory, > disk) on the device running the `snmptrap` command to ensure that it is not > overwhelmed or experiencing resource constraints that could cause the > command to hang. > > 5. Test with a different SNMP manager: Try sending the SNMP inform to a > different SNMP manager or tool to see if the issue persists. This can help > determine if the problem is specific to the SNMP server or if it occurs > with other managers as well. > > 6. Review SNMP library or command versions: Check if there are any known > issues or bugs related to the SNMP library or the `snmptrap` command > version you are using. Consider updating to the latest version or trying an > alternative SNMP library or command implementation. > > If none of the above steps resolve the issue, it might be necessary to > engage the support channels of the SNMP library or the SNMP server vendor > for further assistance. They can provide more specific guidance and help > troubleshoot the problem in-depth. > > Remember to provide them with the relevant details, such as the SNMP > library version, operating system, and any error messages or log entries > associated with the issue. > > Thanks > Kukdeep Paridar > > On Mon, 19 Jun 2023, 3:36 pm Pushpa Thimmaiah, <pushpa.thimma...@gmail.com> > wrote: > >> Hi Kuldeep, >> >> Thanks a lot for quick response. I did check them, it was working fine >> and turned into this state at some point time. >> GDB shows all input args from snmptrap is correct. IP is reachable. >> I have noticed when manager IP unreachable then it would time out with >> error:snmpInform: Timeout. >> >> >> ---------------------------------------------------------------------------------------------------------------------------------------------- >> (gdb) frame 3 >> #3 0x00011e00 in main (argc=19, argv=0x0) at snmptrap.c:377 <----- >> snmp_synch_response() called in this function >> (gdb) info locals >> session = {version = 3, retries = 1, timeout = 2000000, flags = 256, >> subsession = 0x0, next = 0x0, peername = 0x7ed46f05 "192.168.18.69", >> remote_port = 0, localname = 0x0, local_port = 0, authenticator = 0x0, >> callback = 0x12658 <snmp_input>, callback_magic = 0x0, s_errno = 0, >> s_snmp_errno = 0, sessid = 0, community = 0x7ed4672c "public", >> community_len = 6, rcvMsgMaxSize = 1472, sndMsgMaxSize = 0, >> isAuthoritative = 0 '\000', contextEngineID = 0x0, contextEngineIDLen = >> 0, engineBoots = 0, engineTime = 0, contextName = 0x0, >> contextNameLen = 0, securityEngineID = 0x0, securityEngineIDLen = 0, >> securityName >> = 0x29588 "v3", securityNameLen = 2, >> securityAuthProto = 0x76f34384 <usmHMACMD5AuthProtocol>, >> securityAuthProtoLen = 10, >> securityAuthKey = "\274\363\267\031\034\toI\\\331\376\070th\234\345", >> '\000' <repeats 15 times>, securityAuthKeyLen = 16, >> securityAuthLocalKey = 0x0, securityAuthLocalKeyLen = 0, >> securityPrivProto = 0x0, securityPrivProtoLen = 0, >> securityPrivKey = '\000' <repeats 31 times>, securityPrivKeyLen = 0, >> securityPrivLocalKey = 0x0, securityPrivLocalKeyLen = 0, >> securityModel = -1, securityLevel = 2, paramName = 0x0, securityInfo = >> 0x0, transport_configuration = 0x0, myvoid = 0x0} >> ss = 0x2310c >> pdu = 0x2c3e8 >> response = 0x7ed465c0 >> pdu_in_addr_t = <optimized out> >> >> On Mon, Jun 19, 2023 at 3:16 PM Kuldeep Patidar < >> kuldeepatida...@gmail.com> wrote: >> >>> Hello .. >>> >>> From the provided information, it appears that the `snmptrap` command is >>> getting stuck in the `snmp_synch_response_cb()` function in the >>> `snmp_client.c` file. The `state->waiting` flag is set to 1, indicating >>> that it is waiting for a response. >>> >>> To troubleshoot this issue, you can follow these steps: >>> >>> 1. Check the SNMP configuration: Ensure that the SNMP configuration on >>> the device is correct, including the SNMP version, community string, and >>> authentication settings. >>> >>> 2. Verify SNMP server availability: Confirm that the SNMP server is >>> running and reachable from the device where you are executing the >>> `snmptrap` command. You can use tools like `snmpwalk` or `snmpget` to check >>> the SNMP connectivity and retrieve SNMP data from the server. >>> >>> 3. Confirm SNMPv3 settings: Since you mentioned using SNMPv3 informs, >>> verify that the SNMPv3 settings, such as security parameters (username, >>> authentication protocol, privacy protocol) and context name, are correctly >>> configured on both the sending and receiving ends. >>> >>> 4. Check network connectivity: Ensure that there are no network >>> connectivity issues between the device and the SNMP server. Verify that the >>> required ports (typically UDP 161 and 162) are open and accessible. >>> >>> 5. Review SNMP timeout and retries: Although you mentioned that the >>> timeout is set to 2 seconds with 2 retries, it's worth confirming if these >>> settings are appropriate for your environment. You may consider increasing >>> the timeout value or adjusting the number of retries to see if it affects >>> the behavior. >>> >>> 6. Debug SNMP agent/server: Enable SNMP debugging or logging on the >>> receiving SNMP server to gather more information about the incoming >>> `snmptrap` requests. This can help identify any issues on the server side. >>> >>> 7. Update SNMP libraries: If you're using third-party SNMP libraries, >>> make sure they are up to date. There might be known issues or bug fixes in >>> newer versions that could resolve the problem. >>> >>> 8. Consult vendor documentation or support: If the issue persists, it >>> may be beneficial to consult the documentation or reach out to the vendor's >>> support team for assistance. They can provide specific troubleshooting >>> steps or insights related to their SNMP implementation. >>> >>> It's important to note that without additional context or access to the >>> system, it can be challenging to pinpoint the exact cause of the issue. >>> Therefore, the above suggestions should help you investigate and resolve >>> the problem. >>> >>> Thanks >>> Kuldeep patidar >>> >>> >>> >>> On Mon, 19 Jun 2023, 3:13 pm Pushpa Thimmaiah, < >>> pushpa.thimma...@gmail.com> wrote: >>> >>>> >>>> Hi Folks, >>>> >>>> I am using 'snmptrap -Ci ' to send snmpv3 informs . Noticed scenario >>>> on one device where snmptrap command stuck and gdb shows that flow stuck >>>> in snmp_synch_response_cb() . File snmp_client.c, flag state->waiting >>>> set to 1. >>>> Kindly guide . >>>> According to my knowledge, snmpinform will timeout after given period. >>>> Here timeout is 2 seconds and retry 2. >>>> >>>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >>>> bt >>>> #0 0x76e2e850 in select () at ../sysdeps/unix/syscall-template.S:84 >>>> #1 0x76eddb68 in snmp_synch_response_cb (ss=0x2c288, ss@entry=0x2310c, >>>> pdu=pdu@entry=0x2c3e8, response=0x7ebd5558, >>>> response@entry=0x7ebd5550, pcb=<optimized out>) at >>>> snmp_client.c:1060 >>>> #2 0x76eddc40 in snmp_synch_response (ss=ss@entry=0x2310c, >>>> pdu=pdu@entry=0x2c3e8, response=response@entry=0x7ebd5550) at >>>> snmp_client.c:1108 >>>> (gdb) frame 1 >>>> #1 0x76eddb68 in snmp_synch_response_cb (ss=0x2c288, ss@entry=0x2310c, >>>> pdu=pdu@entry=0x2c3e8, response=0x7ebd5558, >>>> response@entry=0x7ebd5550, pcb=<optimized out>) at >>>> snmp_client.c:1060 >>>> 1060 in snmp_client.c >>>> (gdb) info locals >>>> lstate = {waiting = 1, status = 1, reqid = 82488738, pdu = 0x0} >>>> state = 0x7ebd5450 >>>> cbsav = 0x0 >>>> cbmagsav = 0x1 >>>> numfds = 5 >>>> count = <optimized out> >>>> fdset = {fds_bits = {16, 0 <repeats 31 times>}} >>>> timeout = {tv_sec = 0, tv_usec = 0} >>>> tvp = 0x0 >>>> block = 1 >>>> (gdb) frame 2 >>>> #2 0x76eddc40 in snmp_synch_response (ss=ss@entry=0x2310c, >>>> pdu=pdu@entry=0x2c3e8, response=response@entry=0x7ebd5550) at >>>> snmp_client.c:1108 >>>> 1108 snmp_client.c: No such file or directory. >>>> (gdb) info locals >>>> No locals. >>>> (gdb) >>>> (gdb) frame 0 >>>> #0 0x76e2e850 in select () at ../sysdeps/unix/syscall-template.S:84 >>>> 84 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) >>>> (gdb) info locals >>>> No locals. >>>> (gdb) >>>> >>>> ------------------------------------------------------------------------------------------------------ >>>> >>>> Thanks, >>>> Pushpa.T >>>> _______________________________________________ >>>> Net-snmp-coders mailing list >>>> Net-snmp-coders@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders >>>> >>>
_______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders