You can use the ESXi embedded SNMP agent to send virtual machine and environmental traps to management systems. To configure the agent to send traps, you must specify a target address and community.

To send traps with the SNMP agent, you must configure the target (receiver) address, community, and an optional port. If you do not specify a port, the SNMP agent sends traps to UDP port 162 on the target management system by default.

SNMP configuration for ESXi requires the vSphere Command-Line Interface. See Getting Started with vSphere Command-Line Interfaces.

1

From the vSphere CLI, type vicfg-snmp.pl --server hostname --username username --password password -t target_address@port/community.

Replace target_address, port, and community with the address of the target system, the port number to send the traps to, and the community name, respectively. Each 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.

For example, to send SNMP traps from the host host.example.com to port 162 on target.example.com using the public community, type vicfg-snmp.pl --server host.example.com --username user --password password -t target.example.com@162/public.

2

(Optional) If the SNMP agent is not enabled, enable it by typing vicfg-snmp.pl --server hostname --username username --password password --enable.

3

(Optional) Send a test trap to verify that the agent is configured correctly by typing vicfg-snmp.pl --server hostname --username username --password password --test.

The agent sends a warmStart trap to the configured target.