You can use the ESX/ESX 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 ESX/ESXi requires the vSphere CLI. For information on installing and using the vSphere CLI, see vSphere Command-Line Interface Installation and Reference Guide.

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) Enable the SNMP agent 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.