Simple Network Management Protocol (SNMP) allows management programs to monitor and control networked devices. You can manage vSphere 5.0 SNMP agents with vicfg-snmp commands discussed here.
Important Significant enhancements to SNMP, including support for SNMP v3, are included in ESXi 5.1.The new functionality is managed through ESXCLI commands. See the vSphere Monitoring and Performance documentation that is available in the vSphere 5.1 Documentation Center.
■ vCenter Server SNMP agent. The SNMP agent included with vCenter Server can send traps when the vCenter Server system is started or when an alarm is triggered on vCenter Server. The vCenter Server SNMP agent functions only as a trap emitter and does not support other SNMP operations (for example, GET).
■ Host-based embedded SNMP agent. ESXi 4.0 and later includes an SNMP agent embedded in the host daemon (hostd) that can send traps and receive polling requests such as GET requests.You can manage SNMP on ESXi hosts with the vicfg-snmp vCLI command, but not with the vSphere Client or with the ESXCLI command.
■ Net-SNMP-based agent. Versions of ESX released before ESX/ESXi 4.0 include a Net-SNMP-based agent. You can continue to use this Net-SNMP-based agent in ESX 4.x with MIBs supplied by your hardware vendor and other third-party management applications. However, to use the VMware MIB files, you must use the host-based embedded SNMP agent.To use the NET-SNMP based agent and host-based embedded SNMP agent at the same time, make one of the agents listen on a nondefault port. By default, both agents use the same port.The host-based embedded SNMP agent is disabled by default. Configuring and enabling the agent requires that you perform the following tasks:An SNMP community defines a group of devices and management systems. Only devices and management systems that are members of the same community can exchange SNMP messages. A device or management system can be a member of multiple communities.To configure SNMP communities, run vicfg-snmp -c, specifying a comma-separated list of communities. For example:Each time you specify a community with this command, the settings that you specify overwrite the previous configuration.You can use the SNMP agent embedded in ESXi to send virtual machine and environmental traps to management systems. To configure the agent to send traps, you must specify a target (receiver) address, the 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.
2 Run vicfg-snmp --target with the target address, port number, and community.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.You can change the port that the SNMP agent sends data to on the target using the --targets option. That port is UDP 162 by default.The agent sends a warmStart trap to the configured target.If you configure the ESXi embedded SNMP agent for polling, it can listen for and respond to requests such as GET requests from SNMP management client systems.By default, the embedded SNMP agent listens on UDP port 161 for polling requests from management systems. You can use the vicfg-snmp command to configure an alternative port. To avoid conflicts with other services, use a UDP port that is not defined in /etc/services.
Important Both the embedded SNMP agent and the Net-SNMP-based agent available in the ESX 4.x service console listen on UDP port 161 by default. If you are using an ESX 4.x system, change the port for one agent to enable both agents for polling.
1 Run vicfg-snmp --target with the target address, port number, and community.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.You can change the port that the SNMP agent sends data to on the target by using the --targets option. That port is UDP 162 by default.
4 vicfg-snmp <conn_options> -–testwalk –v1 –c public esx-host