Bật SNMP trên vSphere
cd /etc/vmware
cp snmp.xml snamp.xml.bkup
rm -f snmp.xml
vi snmp.xml
<?xml version='1.0' encoding='ISO-8859-1'?>
<config>
<snmpSettings>
<enable>true</enable>
<port>161</port>
<syscontact></syscontact>
<syslocation></syslocation>
<EnvEventSource>indications</EnvEventSource>
<communities>dhxd</communities>
<loglevel>info</loglevel>
<authProtocol></authProtocol>
<privProtocol></privProtocol>
</snmpSettings>
</config>
esxcli system snmp set -r
esxcli system snmp set -c dhxd
esxcli system snmp set -p 161
esxcli system snmp set -L "Hanoi, HBT, VN"
esxcli system snmp set -C admin@huce.edu.vn
esxcli system snmp set -e yes
esxcli system snmp set -r
esxcli system snmp set -e false
esxcli system snmp set --communities dhxd
esxcli system snmp set --targets 192.168.0.55@162/dhxd
esxcli system snmp set --targets 192.168.0.5@162/dhxd
esxcli system snmp set -l debug
esxcli system snmp set -e true
snmpd start
esxcli system snmp status
esxcli system snmp get
esxcli system snmp test
/etc/init.d/snmpd restart
# Chạy trên máy khác
snmpwalk -v2c -c dhxd 192.168.0.153
# esxcli network firewall ruleset set –ruleset-id snmp –allowed-all false
# esxcli network firewall ruleset allowedip add –ruleset-id snmp –ip-address 192.168.0.55/24
# esxcli network firewall ruleset allowedip add –ruleset-id snmp –ip-address 192.168.0.5/24
# esxcli network firewall ruleset set –ruleset-id snmp –enabled true
# esxcli network firewall ruleset set –ruleset-id snmp –allowed-all true
# esxcli network firewall ruleset set –ruleset-id snmp –enabled true