With the VMware ESXi free edition it’s not possible to configure the ESXi server using vSphere CLI commands. However there is another way to edit the SNMP settings.
- Stop all virtual machines on the ESXi host
- Enable SSH access to the ESXi host (configuration -> software -> Security profile)
- SSH to ESXi IP-address
- logon with user ‘root’ and enter password
- go to folder etc/vmware
- make a backup copy of snmp.xml
- edit (use vi) snmp.xml and set it like this
<config>
<snmpSettings>
<enable>true</enable>
<communities>public</
<port>161</port>
<targets>
</snmpSettings>
</config>
NOTE: note the space between the port number (161) and the community name (public)
Install VMware Vsphere CLI 4.1
In windows : logoff and logon again (to set the environment variables)
When running any of the commands below opens a pop-up window with a xml error : LOGOFF AND LOGON !!
Go to folder :
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>
Verify your settings:
vicfg-snmp –server <ESXi_ip> -s
Enter username (root) and password
output :
Enter username: root
Enter password:
Current SNMP agent settings:
Enabled : 1
UDP port : 161
Communities :
public
Notification targets :
192.168.1.100@161/public
Now test your settings:
vicfg-snmp –server <ESXi_ip> -T
Enter username (root) and password
Output:
Sending test nofication(trap) to all configured targets…
Complete. Check with each target to see if trap was received
That’s all…. greetz, M.