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 vCLI, 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 vSphere Command-Line Interface Concepts and Examples.
Configure the ESXi SNMP agent by using the ESXCLI commands. See Getting Started with vSphere Command-Line Interfaces for more information on how to use ESXCLI.
- 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 portHere, 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.
- (Optional) If the ESXi SNMP agent is not enabled, run the following command:
esxcli system snmp set --enable true