The 'esxcli system snmp test' command prompts user to correct the ESXi SNMP agent configuration if certain settings are unconfigured or incorrectly configured. This article gives some examples of these configuration errors and the resulting output from the test command.
For more information on troubleshooting SNMP agent configuration, refer to SNMP inform configuration errors in syslog.
esxcli system snmp get command produces the following output:Authentication:Communities:Enable: falseEngineid:Hwsrc: indicationsLoglevel: infoNotraps:Port: 161Privacy:Remoteusers:Syscontact:Syslocation:Targets:Users:V3targets:esxcli system snmp test produces the following error:Must first configure at least one v1|v2c|v3 trap targetAs the command above indicates, the user must configure one or more targets:
esxcli system snmp set -i <str>
esxcli system snmp set -t <str>esxcli system snmp set -i 10.112.170.205@2263/user2/auth/inform, # -For authNoPriv
10.112.170.205@2264/user3/priv/inform # For authPrivesxcli system snmp test produces the following error:Authentication protocol not defined, security level for target 10.112.170.205@2264 requires itesxcli system snmp set -a SHA1 -x AES128 sets the authentication protocol to SHA1 and the privacy protocol to AES128.esxcli system snmp test produces the following error message:Requires remote user to be defined for user3The esxcli system snmp test command is equivalent to restarting the snmpd agent (both send a warmStart trap).
There are a number of diagnostics available to troubleshoot further.
snmpd: snmpd: SendToIpTransport: sendto(fd=4, length=44) rc = 44snmpd: snmpd: Sr_send_trap_ctx: trap pdu sent to '#.#.#.#:1162' size=44 bytestcpdump-uw can trace outgoing snmp trapstcpdump-uw -v -i vmk# -n -T snmp udp and port ### (typically port 162; if custom ports are configured use those)esxcfg-advcfg -g /UserVars/CIMEnabled) or by suppressing the event with esxcli system snmp set -n option), every 5 minutes an enterprise trap is emitted from sfcbd.esxcli network nic up|down -n vmnic#). Make note of the configurations/states before changing to avoid causing network issues.