Background & Why It Matters
When operating a VMware vSphere virtualization infrastructure in production, the absolute nightmare scenario is an unstable RAM stick, a degraded RAID drive, or a server cooling fan failing in the middle of the night without the on-call team knowing. By the time a virtual machine (VM) crashes or vCenter reports an outage, the incident has already caused widespread service downtime.
Many new system administrators assume that occasionally checking the vCenter Client is sufficient. In reality, once your infrastructure scales to dozens of host nodes, configuring SNMP (Simple Network Management Protocol) to push metrics and traps to centralized monitoring platforms like Zabbix or PRTG becomes indispensable. SNMP enables us to directly query hardware sensor states (Hardware Health via IPMI/CIM sensors), hypervisor CPU/RAM utilization, network traffic across vSwitches, and Datastore storage capacity in real time.
While migrating my home lab from VMware to Proxmox, I noticed several interesting differences. In Proxmox, pushing metrics via InfluxDB or Prometheus is seamlessly integrated directly into the web UI. In contrast, vSphere maintains its traditional enterprise architecture: rock-solid and dependable, yet requiring administrators to configure SNMP via CLI for granular control and optimized monitoring workflows.
Prerequisites & Setup
Before running commands, make sure you have the following network details and services prepared across your infrastructure:
- Community String Planning: Strongly avoid using the default
publicstring. Instead, define a complex string such asitfromzero-snmp-roto safeguard your internal network. - Service Ports: Allow UDP port 161 (SNMP Polling) and UDP port 162 (SNMP Traps) through firewalls between the Monitoring Server and your ESXi hosts/vCenter.
- Enable SSH on ESXi: Log in to the vSphere Client > Select Host > Configure > Services > Start the
SSHservice.
Step-by-Step Configuration
1. Configuring SNMP on VMware ESXi via esxcli
By default, the SNMP agent service on ESXi is disabled. I recommend SSHing directly into the host and using the esxcli system snmp command suite for configuration—it is faster and avoids UI-related glitches.
# 1. Set community string (Read-Only mode)
esxcli system snmp set --communities itfromzero-snmp-ro
# 2. Configure administrative contact and server location
esxcli system snmp set --syscontact "[email protected]" --syslocation "DC-Hanoi-Rack05"
# 3. Allow SNMP traffic through the built-in ESXi firewall
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
# (Advanced Option) Restrict SNMP access to the Monitoring Server IP
# esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
# esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.10.15/32
# 4. Enable the SNMP service
esxcli system snmp set --enable true
# 5. Restart the snmpd service to apply changes
/etc/init.d/snmpd restart
Verify all applied settings with the following command:
esxcli system snmp get
2. Configuring SNMP on vCenter Server Appliance (VCSA)
To monitor entire clusters, aggregated resources, and the status of core vCenter services, configure SNMP directly on the VCSA using the Appliance Shell:
# SSH into VCSA as root
# Set the community string
snmp.set --communities itfromzero-snmp-ro
# Set contact information
snmp.set --syscontact "[email protected]"
# Enable SNMP
snmp.enable
# Check the running status of the SNMP service on vCenter
snmp.get
Verification & Monitoring
1. Verifying Responses with snmpwalk from the Monitoring Server
From your Zabbix server or a Linux workstation on the same management subnet, execute snmpwalk to verify that the ESXi host is returning data:
# Query basic system OID
snmpwalk -v 2c -c itfromzero-snmp-ro 192.168.10.51 1.3.6.1.2.1.1.1
# Query VMware enterprise hardware MIB tree (Enterprise OID 6876)
snmpwalk -v 2c -c itfromzero-snmp-ro 192.168.10.51 1.3.6.1.4.1.6876.1
If the output displays the identifier string VMware ESXi 7.0.3 ..., UDP port 161 communication is clear and the agent is responding accurately.
2. Integrating Monitoring with Zabbix
Zabbix provides robust, built-in templates for VMware monitoring:
- Assign Template: In the Zabbix Server web interface, add a new Host using the ESXi host’s IP address. Link that host to the
VMware ESXi via SNMPorVMware Hypervisor by SNMPtemplate. - Configure Macro: Navigate to the Macros tab and add the macro
{$SNMP_COMMUNITY}with the valueitfromzero-snmp-roconfigured earlier. - Data Collection: After the discovery cycle completes (typically 5–10 minutes), Zabbix will automatically discover and monitor hardware sensor states (power supplies, fan speeds, CPU temperatures, RAID controllers) along with all physical vmnic adapters.
3. Integrating Monitoring with PRTG Network Monitor
For PRTG users:
- Go to Add Device > Enter the ESXi host IP > Under Credentials for SNMP Devices, select SNMP v2c and enter the community string.
- Add the SNMP VMware Host Hardware Sensor. This sensor automatically queries OIDs provided by the CIM/IPMI providers on ESXi.
- Add the SNMP Traffic sensor to graph bandwidth utilization across vSwitch uplinks.
A hard-won tip from real-world deployments: avoid setting polling intervals too short (under 30 seconds) for hardware sensors. VMware’s hardware MIB tree is relatively demanding because it queries the underlying CIM provider layer; polling too frequently can cause unnecessary CPU spikes in ESXi’s hostd or sfcbd processes. An optimal baseline is 60 seconds for Network Traffic and 300 seconds for Hardware Health Sensors.

