I am having trouble writing a class to query for the cpu usage when you pass in a host and the required information. Does anyone have a sample code or a guide on how to write such a program?
Thanks
You can retrieve the below properties from Host object to get the cpu utilization and overallmemoryusage
summary.quickStatsoverallCpuUsage
summary.quickStats.overallMemoryUsage
Thanks
Yvs
Hi,
In order to retrieve the the HostSystem managed object, you can use findByDns or findByIp API to get the HostSystem. Then you can drill down to the overallCpuUsage property ( HostSystem->summary->quickstats->overallcpuUsage) to get the overall cpu usage of the host.
You might want to refer to the sample SearchIndex.cs, shipped with the vSphere SDK package, which demonstrates how to use FindByDns and FindByIp APIs.
Hope this helps.