Configuring SNMP Traps for ESXi/ESX 3.5, 4.x, and 5.x


To generate virtual machine and environmental traps from ESXi/ESX 3.5, 4.x, and 5.x hosts, you must configure and enable the embedded SNMP agent. You cannot use the Net-SNMP-based agent to generate these traps, although it can receive GET transactions and generate other types of traps.This represents a change in behavior from ESX 3.0.x, in which the configuration file for theEE-based agent controlled the generation of virtual machine traps. For more information, see Configuring SNMP on an ESX 3.0.x host (1008186).


Use the command from the Remote CLI or vSphere CLI to enable the SNMP agent and configure trap destinations. Each time you specify a target with the command, the settings you specify overwrite all previously specified settings. To specify multiple targets, specify them in a single command, separated by commas.To enable and configure SNMP traps:


  1. Navigate to the directory where is stored. By default, is located in:

C:Program FilesVMwareVMware vSphere CLIbin

  • Run this --server hostname --username username --password password --show

    Note: Run the --help command for a full list of options.

  • Specify the communities and trap targets with this command: --server hostname --username username --password password -t hostname@port -ccommunity
    Note: In ESX 3.5, you may need to use --server hostname --username username --passwordpassword -t hostname@port/community.

    Example: To send SNMP traps from the host to port 162 on, using the public community, use this command: --server --username root --password password -t -c public

    For ESXi 5.x: --server --username root --password password -t

    Note: To prevent clear text display of the user password, remove the --password password portion. You are then prompted to enter the password, and the entry is hidden.

  • To enable the SNMP service, run this --server hostname --username username --password password --enable

    Note: To verify SNMP settings, run this command: --server hostname --username username --password password --show

  • (Optional) To send a test trap to verify that the agent is configured correctly, run this --server hostname --username username --password password --test

    The test trap generated is a warmStart trap.

    Note: Changes to the SNMP configuration are stored on the ESXi/ESX host in /etc/vmware/snmp.xml.


Based on VMware KB 1008065
Comments are closed.