virtualization:vmware:67:snmp_ena
Configure SNMP on ESXi
Login into VMware host using SSH and root credentials, then set community string that you are going to use, and enable SNMP service.
esxcli system snmp set --communities YOUR_COMMUNITY_STRING esxcli system snmp set --enable true
Replace YOUR_COMMUNITY_STRING with the Community string you are going to use, usually this is Private or Public but I think you need to use some unique string one for security reasons. Enable SNMP on ESXi firewall
Now we need to add a firewall rule to allow inbound SNMP traffic to our ESXi host. For this, we have two options:
1.Allow all traffic for SNMP
2.Allow traffic from specific hosts or subnets
Allow traffic from All hosts
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true esxcli network firewall ruleset set --ruleset-id snmp --enabled true
Allow traffic from specific hosts or subnets
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.1.0/24 esxcli network firewall ruleset set --ruleset-id snmp --enabled true
Restart SNMP Service
Now that we have done our VMware 6.5 SNMP configuration we need to restart the SNMP service
/etc/init.d/snmpd restart
esxcli system snmp set --communities public esxcli system snmp set --enable true esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 10.0.2.0/24 esxcli network firewall ruleset set --ruleset-id snmp --enabled true /etc/init.d/snmpd restart
virtualization/vmware/67/snmp_ena.txt · Last modified: 2019/10/04 07:11 by rplecko