This is a really funny post. Only because I’ve done this a million times yet I had to look it up on how to do it. So hopefully this will help you now and me in the future! 🙂
Let’s get started. With most things we can do things from the GUI. Configuring SNMP from the GUI isn’t possible so we’ll need to SSH directly into our host(s) to get this task done.
Step 1: SSH to the host(s)
If SSH isn’t enabled, go ahead and go to the host, Configure, under System go to Security Profile scroll down to Services and click on Edit. Scroll down and find SSH and enable it.
Step 1.1 Let’s TunnelÂ
Step 2: Set SNMP Community StringÂ
Step 3: Enable SNMP Service
4. Firewall, If you’re running the firewall.Â
You’ll need to allow SNMP to be able to pass-through. We can do that with the following commands. However be aware that this is opening up to EVERYONE.
esxcli network firewall ruleset set –ruleset-id snmp –allowed-all true
esxcli network firewall ruleset set –ruleset-id snmp –enabled true
For a more granular approach we can use specific IPs, such as the following commands.
esxcli network firewall ruleset set –ruleset-id snmp –allowed-all false
esxcli network firewall ruleset allowedip add –ruleset-id snmp –ip-address 10.1.1.123/24
esxcli network firewall ruleset set –ruleset-id snmp –enabled true
Step 5: Restart the SNMP Service (If Needed)
/etc/init.d/snmpd restartÂ
Enabling SNMP automatically turns on the “all” SNMP firewall rules. However, traps are not enabled (i.e., outbound on port 162)