To enable SNMP on a VMware ESXi 6.5 host, connect to it with your favorite SSH client (I use PuTTY) and run the following commands:
esxcli system snmp set --communities public
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
What each step does:
- Sets the SNMP community string (replace
publicwith your own). - Enables the SNMP agent.
- Allows all IPs through the ESXi firewall’s SNMP ruleset, then enables that ruleset.
- Restarts the SNMP service so the changes take effect.
If you copy these commands, make sure the options begin with two hyphens (--), not a single dash. Related: enabling SNMP on a Raspberry Pi.
