After reconfiguring SNMP settings using the esxcli system snmp set command, executing the esxcli system snmp test command fails with the following error:
Agent not responding, connect uds socket(/var/run/snmp.ctl) failed 2, err= No such file or directory
The issue automatically resolves on its own after a few minutes.
After a configuration change is executed via the esxcli system snmp set command, the snmpd service initialization task runs. This initialization includes time-consuming operations, such as scanning datastores. During this initialization period, connections to the snmpd UNIX Domain Socket (UDS) cannot be established. Depending on the total number and capacity of the configured datastores, this process can take several minutes to complete.
This is expected behavior. Please wait a few minutes for the initialization task to complete, then retry the command.