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

Reply via email to