If you configure the ESXi SNMP agent for polling, it can listen for and respond to requests from SNMP management client systems, such as GET, GETNEXT and GETBULK requests.

By default, the embedded SNMP agent listens on UDP port 161 for polling requests from management systems. You can use the esxcli system snmp set command with the --port option to configure an alternative port. To avoid conflicting with other services, use a UDP port that is not defined in /etc/services.

If you run ESXCLI commands through ESXCLI, you must supply connection options that specify the target host and login credentials. If you use ESXCLI commands directly on a host using the ESXi Shell, you can use the commands as given without specifying connection options. For more information on connection options see ESXCLI Concepts and Examples.

Prerequisites

Configure the ESXi SNMP agent by using the ESXCLI commands. See Getting Started with ESXCLI for more information on how to use ESXCLI.

Procedure

  1. Run the esxcli system snmp set command with the --port option to configure the port.
    For example, run the following command:
    esxcli system snmp set --port port
    Here, port is the port the SNMP agent uses to listen for polling requests.
    Note: The port you specify must not be already in use by other services. Use IP addresses from the dynamic range, port 49152 and up.
  2. (Optional) If the ESXi SNMP agent is not enabled, run the following command:
    esxcli system snmp set --enable true