VMware Esxi 4.1 and SNMP

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.

  1. Stop all virtual machines on the ESXi host
  2. Enable SSH access to the ESXi host (configuration -> software -> Security profile)
  3. SSH to ESXi IP-address
  4. logon with user ‘root’ and enter password
  5. go to folder etc/vmware
  6. make a backup copy of snmp.xml
  7. edit (use vi) snmp.xml and set it like this

<config>

<snmpSettings>

<enable>true</enable>

<communities>public</communities>

<port>161</port>

<targets>MySNMPTrapDestinationIP@161 public</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.

 

Visitor Score
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *