6.5

Table Of Contents
Configure a Trap Destination with ESXCLI
You can use ESXCLI to congure a trap destination and send traps.
Specify one of the options listed in “Connection Options for vCLI Host Management Commands,” on
page 19 in place of <conn_options>.
Procedure
1 Make sure a community is set up.
esxcli system snmp get <conn_options>
Current SNMP agent settings:
Enabled: 1
UDP port: 161
Communities: public
Notification targets:
2 Set the target address, port number, and community.
esxcli <conn_options> system snmp set -t target.example.com@163/public
Each time you specify a target with this command, the seings you specify overwrite all previously
specied seings. To specify multiple targets, separate them with a comma.
You can change the port that the SNMP agent sends data to on the target using the --targets option.
That port is UDP 162 by default.
3 (Optional) Enable the SNMP agent if it is not yet running.
esxcli <conn_options> system snmp set --enable=yes
4 (Optional) Send a test trap to verify that the agent is congured correctly.
esxcli <conn_options> system snmp test
The agent sends a warmStart trap to the congured target.
Configure a Trap Destination with vicfg-snmp
You can use vicfg-snmp to congure a trap destination and send traps.
Specify one of the options listed in “Connection Options for vCLI Host Management Commands,” on
page 19 in place of <conn_options>.
Procedure
1 Make sure a community is set up.
vicfg-snmp <conn_options> --show
Current SNMP agent settings:
Enabled: 1
UDP port: 161
Communities: public
Notification targets:
2 Run vicfg-snmp --target with the target address, port number, and community.
vicfg-snmp <conn_options> -t target.example.com@163/public
Chapter 10 Monitoring ESXi Hosts
VMware, Inc. 167