Configuring SNMP Agent Parameters in ESXi
Specify the monitoring server IP address (SNMP target), port (by default, 161 UDP) and SNMP community name (usually, public):
esxcli system snmp set --targets=192.168.99.99@161/public
Or you can set the community name as follows:
esxcli system snmp set --communities YOUR_COMMUNITY_STRING
Additionally, you can specify the location:
esxcli system snmp set --syslocation "Allee 16, Mun, DE"
Contact information:
esxcli system snmp set --syscontact [email protected]
Then enable SNMP service on the ESXi host:
esxcli system snmp set --enable true
To test the SNMP configuration:
esxcli system snmp test
ESXi Firewall Configuration for SNMP Traffic
You can allow SNMP traffic in your ESXi host firewall in two ways. To allow SMNP requests from any device on the network:
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
Or you can allow inbound traffic from an IP address of your monitoring server or an IP subnet where your SNMP servers are located:
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.100.0/24
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
http://woshub.com/configure-snmp-vmware-esxi/