ESXi Monitoring


I found a few interesting links about using snmp with VMWare ESXi, or more generally monitoring with Nagios.

There’s a python script that will do hardware monitoring IF the system supports that (think big name servers HP/Dell/IBM). It will work using WBEM.

In general, SNMP is disabled. Sending traps on issues is the first step and somewhat documented, and probably the most important part when coming to larger environments.

But you also can enable SNMP queries as described here:

http://www.matthewjwhite.co.uk/blog/2010/02/10/esxi-enabling-snmp/

As the author points out, this will not show a lot of information, a snmpwalk only returns the if-mib, so you’ll see basic snmp stuff, interface load for nics and thats it.

But behold!

Let’s look at that snmpwalk more closely by just looking at the MIB description table:

# snmpwalk -c publicĀ  -v 1 192.168.xxx.xxx SNMPv2-MIB::sysORDescr
SNMPv2-MIB::sysORDescr.1 = STRING: SNMPv2-MIB, RFC 3418
SNMPv2-MIB::sysORDescr.2 = STRING: IF-MIB, RFC 2863
SNMPv2-MIB::sysORDescr.3 = STRING: VMWARE-SYSTEM-MIB, REVISION 200801120000Z
SNMPv2-MIB::sysORDescr.4 = STRING: VMWARE-VMINFO-MIB, REVISION 200810230000Z
SNMPv2-MIB::sysORDescr.5 = STRING: VMWARE-RESOURCES-MIB, REVISION 200810150000Z

Now guys, guess what these do – just use the VMWare supplied mibs and query those and you can access the data about your VM configs and so on!

I just googled for the VMWARE-VMINFO-MIBs OID real quick and gave it a test run:

snmpwalk -c publicĀ  -v 1 192.168.xxx.xxx 1.3.6.1.4.1.6876.2.1

[…]

SNMPv2-SMI::enterprises.6876.2.1.1.2.16 = STRING: “wafh0001”
SNMPv2-SMI::enterprises.6876.2.1.1.2.32 = STRING: “hp-lefthand-VSA”
SNMPv2-SMI::enterprises.6876.2.1.1.2.48 = STRING: “waxu0500”
SNMPv2-SMI::enterprises.6876.2.1.1.3.16 = STRING: “/vmfs/volumes/4c49e3d8-<guidremoved>/wafh0001/wafh0001.vmx”
SNMPv2-SMI::enterprises.6876.2.1.1.3.32 = STRING: “/vmfs/volumes/4c49e3d8-<guidremoved>/hp-lefthand-VSA/hp-lefthand-VSA.vmx”
SNMPv2-SMI::enterprises.6876.2.1.1.3.48 = STRING: “/vmfs/volumes/4c49e3d8-<guidremoved>/waxu0500_1/waxu0500_1.vmx”
SNMPv2-SMI::enterprises.6876.2.1.1.4.16 = STRING: “E: tools not installed”
SNMPv2-SMI::enterprises.6876.2.1.1.4.32 = STRING: “E: tools not installed”
SNMPv2-SMI::enterprises.6876.2.1.1.4.48 = STRING: “E: tools not installed”
SNMPv2-SMI::enterprises.6876.2.1.1.5.16 = INTEGER: 768
SNMPv2-SMI::enterprises.6876.2.1.1.5.32 = INTEGER: 1024
SNMPv2-SMI::enterprises.6876.2.1.1.5.48 = INTEGER: 512
SNMPv2-SMI::enterprises.6876.2.1.1.6.16 = STRING: “poweredOn”
SNMPv2-SMI::enterprises.6876.2.1.1.6.32 = STRING: “suspended”
SNMPv2-SMI::enterprises.6876.2.1.1.6.48 = STRING: “poweredOn”

I’ll provide more documentation. Probably these 3 also don’t give half as much as using the desired way, but host memory usage and vm status (running/not running) happens to be just the thing I want!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s