Configure the SNMP
Agent for Polling with ESXCLI
You can use ESXCLI
to configure the SNMP agent for polling.
Specify one of the options
listed in
Connection Options for vCLI Host Management Commands
in place of
<conn_options>
.
- Runvicfg-snmp --targetwith the target address, port number, and community.vicfg-snmp <conn_options> -c public -t target.example.com@163/publicEach time you specify a target with this command, the settings you specify overwrite all previously specified settings. To specify multiple targets, separate them with a comma.You can change the port that the SNMP agent sends data to on the target by using the--targetsoption. That port is UDP 162 by default.
- Specify a port for listening for polling requests.vicfg-snmp <conn_options> -p <port>
- If the SNMP agent is not enabled, enable it.vicfg-snmp <conn_options> --enable
- Runvicfg-snmp --testto validate the configuration.vicfg-snmp <conn_options> --test
Running Commands in
Sequence
The following example shows
how the commands are run in sequence.
vicfg-snmp <conn_options> –c public –t example.com@162/private --enable # next validate your config by doing these things: vicfg-snmp <conn_options> -–test walk –v1 –c public esx-host