How to enable SNMP monitoring for VMWare ESXi 6.0/6.5

You can do a lot of configuration of ESXi through the GUI, but one thing I’ve found that you cannot do is configure SNMP.

I can see in  the GUI that SNMP service is stopped, and that’s about it:

 

  • Even if you can manage to get the service started from the GUI, you’ll still have to set your community string somehow. I couldn’t exactly find a place to set that, so it’s off to the CLI we go.

So here’s how to enable SNMP and configure the community string/firewall on ESXi 6.0 or 6.5:

1. SSH to host

  • SSH should be enabled. If not, enable it.

 

2. Set SNMP community string

  • Enter the following command to set your string, replacing YOUR_COMM_STRING with your own.

 

3. Enable SNMP service

  • Enter the following command to enable the SNMP service

 

4. Adjust firewall

  • Chances are that your ESXi firewall is already allowing this traffic, but just in case, allow connections from anywhere.

  • This is very lenient but recommended for beginners or lab environments.

 

  • A more secure approach would be to restrict access to a range of IPs or a particular host. In this case, we are only allowing 192.168.0.0-192.168.0.254 to poll SNMP.

 

5. Restart SNMP service

It took a good 30-45 seconds for the service to restart on my host. Once this is done, you can confirm that the service is running via GUI:

 

That’s it!

  • Here’s a transcript of my shell session, for your reference:

 

Personally I am utilizing OpenNMS Horizon to graph the SNMP Interface Data for the VM Network.

I hope this helps. Thank you for reading.

One Thought to “How to enable SNMP monitoring for VMWare ESXi 6.0/6.5”

  1. turnpike420

    ESXi 6.0.0 build 4600944: when I follow the above and run “esxcli system snmp get” just before running the restart command it returns Enable: true; however after I run the restart command it returns Enable: false so I have to re-run “esxcli system snmp set –enable true”. Only then can I snmpwalk the ESXi system. Also, Enable: true is not persistent after an ESXi host reboot. The firewall and community name settings appear to remain persistent after reboot. I added the enable true line to /etc/rc.local.d/local.sh and that made it persistent after reboot.

Leave a Reply