As I mentioned in an earlier post one of the issues we’ve had with the idea of deploying ESX 3i vs 3.5 is the ability to monitor the hardware since neither the DRAC card nor the BMC via IPMI seem to be able to give us all the info we need. I had looked briefly at the VI-Perl toolkit and the VI SDK but not spent a lot of time on it.
I installed 3i on a new PE 2900 today to take a look at this again. I had previously pulled one of the disks in the server so that I could be certain something was “wrong” so I had something to test against. Below is the “Health Status” as shown via the VI client. As you can see “Storage” shows up as being in a warning state since RAID 6 Virtual Disk shows as being in a “Warning” state. It’s worth noting that since I pulled a hard drive Physical Disk 7 does not show in the list of items under Storage. I’m assuming that if the drive was actually bad it’d show up as failed. But I don’t know that I want to damage a perfectly good drive to find out.

You can also see this same info via the “Browse Objects managed by this host” option on the local web page for the host. (http://<esx_ip_address>/mob).

As you browse through the managed objects you’ll notice each screen has a Properties and a Methods section. The Properties section will have three columns Name, Type and Value. The path to get to the storage info object is presented using a Name (Value) format. [ex: on the screen below to represent the value "content" would be written as content(content)] If you don’t want to navigate manually you can try the following URL:

Home MOB Page -> Content(content) -> rootFolder(ha-folder-root) -> childEntity(ha-datacenter) -> hostFolder (ha-folder-host) -> Child-entity(ha-compute-res) -> Host (ha-host) -> configManager(configManager) -> healthStatusSystem(healthStatusSystem) -> Runtime(runtime) ->Hardwarestatusinfo (hardwareStatusInfo) -> Storagestatusinfo(storageStatusInfo)
Once there you’ll (hopefully) see that we have an array of HostStorageElementInfo objects. Here we’re interested mainly in the name and status->key values.
|
[11] |
HostStorageElementInfo |
|
All of this info should be accessible via the VI SDK. I had earlier tried to download the VI Perl Toolkit for both Windows and Linux but was having issues with the Windows version. I also has some issues with the Linux version but that was solved by downloading and building some modules that aren’t apparently part of the standard perl install. Rather than mucking with that too long, I downloaded and installed the VI Perl Toolkit Virtual Appliance. This virtual appliance is unfortunately in Open Virtual Machine Format (OVF) which meant I had to go download another tool from the VMware website to convert it for use with ESX. Once I got it up and running I was able to run some of the sample scripts to get a feel for what they did and how they worked.
In a little while I was able to take one of them, datacenterlisting.pl and modify it to show me the same storage info I was able to see via the VI client. This is where the ability to use the manage objects browser came in handy since that provided the info I needed to be able to modify the script to get what I wanted. This first version doesn’t do anything fancy, it simply lists each of the storage elements and their status as Red, Yellow, or Green. If we have to run a script to regularly monitor the servers we’re deploying we’ll probably use already existing internal Nagios server to monitor these ESX boxes. That will require a slightly less verbose version of the script that only really outputs info when there’s an issue.
Here’s the simple version of the script. There’s a sample below of the command line. But you need to specify a user, password and ipaddress/hostname for the server you’re checking on. You should also be able to point this script at Virtual Center but I don’t know what it will do if it encounters 3.5 hosts vs 3i hosts. I added a dummy user for nagios on the host with readonly permissions since that’s our ultimate target.
check_3i_storage_simple –password <passwd> –username <user> –server <ip addr/hostname> –datacenter ha-datacenter
the setting ‘ha-datacenter’ is the value at the root of the managed object hierarchy that we use to find the host info. (This is true even on a standalone host).
visdk@vaos:~$ ./check_3i_storage_simple –password badpassword –username root –server 11.22.33.44 –datacenter ha-datacenter
Datacenter = ha-datacenter Hosts found: 1: w35d154.company.com Boot time 2008-02-21T12:36:34.19314Z Controller 0 (PERC 6/i Integrated) Has status of Green Battery of Controller 0 Has status of Green Physical Disk 0/E32 of Controller 0 Has status of Green Physical Disk 1/E32 of Controller 0 Has status of Green Physical Disk 2/E32 of Controller 0 Has status of Green Physical Disk 3/E32 of Controller 0 Has status of Green Physical Disk 4/E32 of Controller 0 Has status of Green Physical Disk 5/E32 of Controller 0 Has status of Green Physical Disk 6/E32 of Controller 0 Has status of Green Physical Disk 8/E32 of Controller 0 Has status of Green Physical Disk 9/E32 of Controller 0 Has status of Green RAID 6 Virtual Disk 0 of Controller 0 Has status of Yellow Port 0 of Controller 0 Has status of Green Port 1 of Controller 0 Has status of Green Port 2 of Controller 0 Has status of Green Port 3 of Controller 0 Has status of Green Port 4 of Controller 0 Has status of Green Port 5 of Controller 0 Has status of Green Port 6 of Controller 0 Has status of Green Port 7 of Controller 0 Has status of Green
visdk@vaos:~$
Reference stuff:
The VI-Perl toolkit in its various incarnations as well as the VMware Infrastructure SDK are available from VMware at http://www.vmware.com/support/pubs/sdk_pubs.html To actually download components you have to have an account on their site.
The original script that I started with is in the samples/discovery folder and called datacenterlisting.pl.









[...] I’ve been working with one of my coworkers in looking at Zabbix for monitoring rather than Nagios for the Global Ops Virtualization rollout. I’ve already done work on some monitoring of ESX3i with Nagios by writing some plugins to monitor different hardware components. (For more info see this blog post) [...]
[Translate]