Configuring SNMP for monitoring on ESXi 4.1
If you’re like most people you use the free edition of ESXi 4.1 server. Why not?
Most small businesses and companies do not need live motion, storage v-motion, and DRS and can live with a few minutes of downtime if an ESX server crashes (how often does this happen? LOL). The VMware licenses often cost more than the physical servers and therefore are out of reach of all but the plushest hedge funds, banks and financial exchanges, many of whom still balk at paying $10,000 to $20,000 to license ESXi features that buy them a few minutes more of uptime, about once every 2-5 years if a server dies :)
(We have ways to script re-start of vm’s on free edition of ESXi)
But as a Managed Services Provider we still must monitor every aspect of ESXi, including performance, availability, and the state of the virtual machines being hosted!
In order to do this, we must first enable the SNMP agent already available on every install of ESX 4 - 4.1.
Let’s get started-
1. Enable SSH remote management of the ESXi server from within the Vsphere client (Configuration, Software Section, Security Profile, Services, Properties -> Press “remote tech support (SSH)”) As shown

and choose the “Options” button. Make sure this is set to “Start Automatically”

Now, we can SSH remotely into our ESXi Host server and edit the following file

Using VI let’s edit the snmp.xml file with the following syntax (note: the target=the server’s IP where SNMP queries and walks will arrive, NOT the SOURCE IP where they will ORIGINATE)

Here’s a sample of the contents of snmp.xml so you can copy, edit and paste;
<config>
<snmpSettings>
<enable>true</enable>
<communities>public</communities>
<targets>10.21.21.12@161/public</targets>
<port>161</port>
</snmpSettings>
</config>
Now, let’s save the changes to our snmp.xml in VI

(use the :wq! write/quit option)
Last, let’s restart the vmware services using the “services.sh” script that is in the
/etc/vmware directory on ESXi

Now, using your SNMP string you can monitor your ESXi server from your NMS;
some common mib’s include
Monitor Name : Memory Used By VM
System OID : (.1.3.6.1.4.1.6876.3.2.4.1.4*100)/.1.3.6.1.4.1.6876.3.2.4.1.3
Monitor Name : CPU Utilization of VM
System OID : (.1.3.6.1.4.1.6876.3.1.2.1.3*100)/$DELTA_TIME
Monitor Name : CPU Utilization(UCD SNMP MIB)
System OID : .1.3.6.1.4.1.2021.11.9.0
Monitor Name : CPU Utilization(UCD SNMP MIB)
System OID : .1.3.6.1.4.1.2021.11.9.0
Monitor Name : Disk Utilization
System OID : .1.3.6.1.2.1.25.2.3.1.6
Enjoy!