What you get from ESXi using SNMP
303 words, 2 minutes
I already wrote about how to enable and configure SNMP on VMware ESXi 5 . But I was quite short on what you really get from SNMP. Here’s a bit more details.
The first thing to do is have a look at the VMware MIB Files documentation. There you’ll find a full description of the information you’ll get from SNMP.
Install the MIB files on your monitoring machine as issue the following command:
# snmpwalk -M +/where/the_mib_files/are -m ALL -c community -v 2c esxi.local 1.3.6.1.4.1.6876
VMWARE-SYSTEM-MIB::vmwProdName.0 = STRING: VMware ESXi
VMWARE-SYSTEM-MIB::vmwProdVersion.0 = STRING: 5.0.0
VMWARE-SYSTEM-MIB::vmwProdBuild.0 = STRING: 469512
VMWARE-SYSTEM-MIB::vmwProdUpdate.0 = STRING: 0
VMWARE-SYSTEM-MIB::vmwProdPatch.0 = STRING: 0
VMWARE-VMINFO-MIB::vmwVmDisplayName.1 = STRING: bagheera
VMWARE-VMINFO-MIB::vmwVmDisplayName.3 = STRING: ESXi
VMWARE-VMINFO-MIB::vmwVmDisplayName.5 = STRING: WinXP
VMWARE-VMINFO-MIB::vmwVmDisplayName.6 = STRING: Zenoss
(...)
VMWARE-VMINFO-MIB::vmwVmGuestOS.1 = STRING: OpenBSD 5.0 GENERIC.MP#63
VMWARE-VMINFO-MIB::vmwVmGuestOS.3 = STRING: E: tools not installed
VMWARE-VMINFO-MIB::vmwVmGuestOS.5 = STRING: Windows XP Professional x64 Edition Service Pack 2 (Build 3790)
VMWARE-VMINFO-MIB::vmwVmGuestOS.6 = STRING: E: tools not running
(...)
VMWARE-VMINFO-MIB::vmwVmMemSize.1 = INTEGER: 4096 megabytes
VMWARE-VMINFO-MIB::vmwVmMemSize.3 = INTEGER: 8192 megabytes
VMWARE-VMINFO-MIB::vmwVmMemSize.5 = INTEGER: 1024 megabytes
VMWARE-VMINFO-MIB::vmwVmMemSize.6 = INTEGER: 2048 megabytes
(...)
VMWARE-RESOURCES-MIB::vmwNumCPUs.0 = Gauge32: 1
VMWARE-RESOURCES-MIB::vmwMemSize.0 = Gauge32: 16686972 kilobytes
VMWARE-RESOURCES-MIB::vmwMemCOS.0 = Gauge32: 0 kilobytes
VMWARE-RESOURCES-MIB::vmwMemAvail.0 = Gauge32: 16686972 kilobytes
VMWARE-RESOURCES-MIB::vmwHostBusAdapterNumber.0 = INTEGER: 6
VMWARE-RESOURCES-MIB::vmwHbaDeviceName.1 = STRING: vmhba0
(...)
You can audit a Virtual Machine parameters using such a command:
# snmpwalk -M +/where/the_mib_files/are -m ALL -c community -v 2c esxi.local vmwVmTable | grep "\.14 = "
VMWARE-VMINFO-MIB::vmwVmDisplayName.14 = STRING: Nexenta
VMWARE-VMINFO-MIB::vmwVmConfigFile.14 = STRING: /vmfs/volumes/4f4a6e6c-0f8dc733-2e8c-00012e3d30a0/Nexenta/Nexenta.vmx
VMWARE-VMINFO-MIB::vmwVmGuestOS.14 = STRING: SunOS 5.11
VMWARE-VMINFO-MIB::vmwVmMemSize.14 = INTEGER: 4096 megabytes
VMWARE-VMINFO-MIB::vmwVmState.14 = STRING: poweredOn
VMWARE-VMINFO-MIB::vmwVmVMID.14 = INTEGER: 14
VMWARE-VMINFO-MIB::vmwVmGuestState.14 = STRING: running
VMWARE-VMINFO-MIB::vmwVmCpus.14 = INTEGER: 2
VMWARE-VMINFO-MIB::vmwVmUUID.14 = STRING: "42396952-0703-c1c1-74a3-2dcb0e1c976b"
From what I understood, there is no way to get real-time metrics, like CPU or memory usage. To monitor such information, you have to use the vSphere API.
That’s All Folks!