Enabling SNMP on VMware ESXi

I always struggle to remember the steps to enable SNMP on ESXi hosts so this post can not help me, but might be useful to others.

How to enable SNMP on ESXi 5.5

  1. Ensure that SSH is enabled on your host(s)
  2. SSH to your host using the root credentials
  3. Once connected run the following commands which will set the community string (as specified by COMMUNITY-STRING, enable SNMP, update the host firewall rules, and finally restart the SNMP service

esxcli system snmp set --communities COMMUNITY-STRING
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

How to enable SNMP on ESXi 6.0

  1. Ensure that SSH is enabled on your host(s)
  2. SSH to your host using the root credentials
  3. Once connected run the following commands which will first reset the SNMP configuration. set the community string (as specified by COMMUNITY-STRING, set the SNMP port number, set the SNMP location information, set the SNMP contact information and finally enable SNMP

esxcli system snmp set -r
esxcli system snmp set -c COMMUNITY-STRING
esxcli system snmp set -p 161
esxcli system snmp set -L "Location (City, State, Country)"
esxcli system snmp set -C email@domain.com
esxcli system snmp set -e yes

Leave a Reply

Your email address will not be published. Required fields are marked *