What you get from ESXi using SNMP

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!

3 Comments

  • Stanislav Wed, 15 May 2013 20:42:27 +0000 Reply

    Good day!

    And you did not tell me what could be the Problem?

    # snmpwalk -M +/usr/share/snmp/mibs -m ALL -c community -v2c 192.168.1.111 vmwVmTable
    Timeout: No Response from 192.168.1.111
    ]# snmpwalk -M /usr/share/snmp/mibs -m ALL -c community -v2c 192.168.1.111 vmwVmTable
    Timeout: No Response from 192.168.1.111
    # snmpwalk -M /usr/share/snmp/mibs -c community -v2c 192.168.1.111 vmwVmTable
    No log handling enabled – turning on stderr logging
    vmwVmTable: Unknown Object Identifier (Sub-id not found: (top) -> vmwVmTable)

    As we add more files .mib to the server esxi5.1?
    Example:
    VMWARE-AGENTCAP-MIB.mib
    VMWARE-CIMOM-MIB.mib
    VMWARE-ENV-MIB.mib
    VMWARE-OBSOLETE-MIB.mib
    VMWARE-PRODUCTS-MIB.mib
    VMWARE-RESOURCES-MIB.mib
    VMWARE-ROOT-MIB.mib
    VMWARE-SRM-EVENT-MIB.mib
    VMWARE-SYSTEM-MIB.mib
    VMWARE-TC-MIB.mib
    VMWARE-VC-EVENT-MIB.mib
    VMWARE-VCOPS-EVENT-MIB.mib
    VMWARE-VMINFO-MIB.mib

    On the server, only those that are installed below:

    SNMPv2-MIB::sysORDescr.1 = STRING: SNMPv2-MIB, RFC 3418
    SNMPv2-MIB::sysORDescr.2 = STRING: IF-MIB, RFC 2863
    SNMPv2-MIB::sysORDescr.3 = STRING: IP-MIB, RFC 4293
    SNMPv2-MIB::sysORDescr.4 = STRING: IP-FORWARD-MIB, RFC 4292
    SNMPv2-MIB::sysORDescr.5 = STRING: UDP-MIB, RFC 4113
    SNMPv2-MIB::sysORDescr.6 = STRING: TCP-MIB, RFC 4022
    SNMPv2-MIB::sysORDescr.7 = STRING: ENTITY-MIB, RFC 4133
    SNMPv2-MIB::sysORDescr.8 = STRING: IEEE8021-BRIDGE-MIB, REVISION 200810150000Z
    SNMPv2-MIB::sysORDescr.9 = STRING: IEEE8021-Q-BRIDGE-MIB, REVISION 200810150000Z
    SNMPv2-MIB::sysORDescr.10 = STRING: IEEE8023-LAG-MIB, REVISION 200706200000Z
    SNMPv2-MIB::sysORDescr.11 = STRING: LLDP-V2-MIB, REVISION 200906080000Z
    SNMPv2-MIB::sysORDescr.12 = STRING: HOST-RESOURCES-MIB, RFC 2790
    SNMPv2-MIB::sysORDescr.13 = STRING: VMWARE-SYSTEM-MIB, REVISION 201008020000Z
    SNMPv2-MIB::sysORDescr.14 = STRING: VMWARE-VMINFO-MIB, REVISION 201006220000Z
    SNMPv2-MIB::sysORDescr.15 = STRING: VMWARE-RESOURCES-MIB, REVISION 200810150000Z
    SNMPv2-MIB::sysORDescr.16 = STRING: VMWARE-CIMOM-MIB, REVISION 201008200000Z
    SNMPv2-MIB::sysORDescr.17 = STRING: VMWARE-ENV-MIB, REVISION 201005120000Z

    Thank you!

    • Joel Carnat Wed, 19 Jun 2013 15:10:39 +0000 Reply Author

      The 2 first commands would mean the SNMP server is not running.

      As for MIB files, you don’t install them on the server. You have them installed on the client side and reference them to not use OID.

  • Michael MacFaden Tue, 07 Apr 2015 16:25:36 +0000 Reply

    Real time metrics came in 5.1 and later releases.
    Also there is a new mib module for monitoring Virtual Machines just now working its way through IETF standards process that would make it simple to monitor VMs from a number of virtualization platforms, see
    https://datatracker.ietf.org/doc/draft-asai-vmm-mib/

Leave a Reply

%d bloggers like this: