Configure SNMP trap destination using esxcli commands

Prerequisites

To configure the SNMP trap destination, run the following esxcli commands in a shell using SSH client (PuTTY) when the SSH connection is enabled on the VMware ESXi host:

Steps

  1. To set the community name, run the following command:
    esxcli system snmp set --communities <community_name>
  2. To set the SNMP trap destination, run the following command:
    esxcli system snmp set --targets=<trap_destination_ip>@162/public
  3. To enable the SNMP trap, run the following command:
    esxcli system snmp set --enable true