Enable SNMP on VMware ESXi host

Simple Network Management Protocol (SNMP) allows management programs to monitor VMware and control networked devices in VMware ESXi. SNMP configuration for ESXi requires vSphere Command-Line Interface.

vCenter Server and ESXi systems include different SNMP agents.

  • 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.
  • 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.
  • 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.

The host-based embedded SNMP agent is disabled by default. You must configure at least one community for the agent. Use the below steps to Enable SNMP on VMware ESXi host.

Enable SNMP on VMware ESXi 5.5

SSH to your ESXi host using root credentials.

Use the following commands to enable SNMP. Replace CommunityString with your desired community string.

# esxcli system snmp set --communities <CommunityString>
# esxcli system snmp set --enable true
# esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
# esxcli network firewall ruleset set --ruleset-id snmp --enabled true
# /etc/init.d/snmpd restart

Enable SNMP on VMware ESXi 6.x

SSH to your ESXi host using root credentials.

Use the following commands to enable SNMP. Replace CommunityString with your desired community string.

# esxcli system snmp set -r
# esxcli system snmp set -c <CommunityString>
# esxcli system snmp set -p 161
# esxcli system snmp set -L "City, State, Country"
# esxcli system snmp set -C [email protected]
# esxcli system snmp set -e yes

That’s it.

Test Your VMware ESXi SNMPd Service with Snmpwalk

The simplest way to test your snmpd service is to walk it with snmpwalk on your linux server.

# snmpwalk -v 1 -c CommunityString esxihost1.cloudkb.net

Refer the following screen to check the SNMP service and ports on vcenter security profile.

 

SNMP on ESXi