VMWare ESX/ESXi CPU usage
I'm using Visual studio 2010 and (native) C++ trying to extract the overall CPU usage of the VMWare host and then the 开发者_运维知识库CPU usage of each running VM.
I've looked into VMWare Webservice SDK 4.1 using gSoap to build a C++ interface, but its to slow and to cluncky to be a realistic alternative (resulting cpp files take 4 hours to compile and end up as a 70 MB binary, that would be ok, if not a single call would take minutes to execute).
Do anyone have a tips on an alternative solution/sdk ?
I assume you've gone over all known VMware APIs, so how about this different approach... Simply SSH into the ESX machine and execute some command line utilities to get the information you need. To get all the information you may ever need, you can execute esxtop -b -n1
.
To connect using SSH, you can use plink.exe that allows you to execute stuff from the command line, much like ssh
on Linux machines. You can also use one of the many available SSH libraries, such as libssh.
How important is it to use a VMWare specific solution? Besides using a webservice or VIX which just wrap calls to a soap server for ESX, maybe you're overlooking the simplest solution here. Gathering and monitoring details about the performance of any host is best done with snmp or so I'd like to believe. Its simple; it does what you're asking for and you don't have to deal with the overhead of the SDK.
If you decide to use an SNMP solution, I recommend net-snmp.
精彩评论