Skip to content

Instantly share code, notes, and snippets.

@csamsel
Created June 14, 2018 20:11
Show Gist options
  • Save csamsel/cf448621fac2da1cfd56726368c21274 to your computer and use it in GitHub Desktop.
Save csamsel/cf448621fac2da1cfd56726368c21274 to your computer and use it in GitHub Desktop.
activate snmpd on esxi vmhost
# set community name, change for maximum security
[root@oxygen-vmhost:~] esxcli system snmp set --communities public
# activate snmp
[root@oxygen-vmhost:~] esxcli system snmp set --enable true
# firewall policy defaults to deny
[root@oxygen-vmhost:~] esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
# allow specific ip range
[root@oxygen-vmhost:~] esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.2.0/24
# activate firewall rule set
[root@oxygen-vmhost:~] esxcli network firewall ruleset set --ruleset-id snmp --enabled true
# start service
[root@oxygen-vmhost:~] /etc/init.d/snmpd restart
root: snmpd Running from interactive shell, running command: esxcli system snmp set -e false.
root: snmpd setting up resource reservations.
root: snmpd opening firewall port(s) for notifications.
root: snmpd watchdog for snmpd started.
#done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment