VMware {code} Community
programmer330
Contributor
Contributor
Jump to solution

Virtualmachine-specific counters through the Web Services SDK

Hello,

I'm developing a monitorapp in C# with the web services SDK.

I'm able to get a list of all the performance counters with the PerformanceManager.

ObjectContent[] oCont = getPropertyContent("PerformanceManager", "perfCounter", _serviceContent.perfManager);

I'm asking this directly to an ESX 4.

The answer i get back contains all the available counters but there's no division between Host and Virtual Machine -counters.

For example cpu.utilization is only available for the host and not for a virtual machine.

Is it possible to somehow know what counters are vm-specific?

I'm able to get the managed object references for the vms if that's any help..

Thanks in advance!

Glenn

0 Kudos
1 Solution

Accepted Solutions
njain
Expert
Expert
Jump to solution

Hi Glenn,

The "perfCounter" property of PerformanceManager will fetch all the counters that are available in the host or vCenter. It does not provide any mechanism to filter the counters. In order to get available counters specific to a managed entity (Host, VM, etc. ) you need to use QueryAvailablePerfMetric method. Invoking this method against virtual machine's MOR, you will get all the applicable counter IDs for this VM.

http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.PerformanceManager.html#...

Hope this helps!

Neha

View solution in original post

0 Kudos
2 Replies
njain
Expert
Expert
Jump to solution

Hi Glenn,

The "perfCounter" property of PerformanceManager will fetch all the counters that are available in the host or vCenter. It does not provide any mechanism to filter the counters. In order to get available counters specific to a managed entity (Host, VM, etc. ) you need to use QueryAvailablePerfMetric method. Invoking this method against virtual machine's MOR, you will get all the applicable counter IDs for this VM.

http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.PerformanceManager.html#...

Hope this helps!

Neha

0 Kudos
programmer330
Contributor
Contributor
Jump to solution

Worked like a charm!

Thank you!

Glenn

0 Kudos