VMware {code} Community
kumar_sudhir1
Contributor
Contributor

How to get the Network and CPU Utilization value by using VI SDK

Can i get the Network, CPU Utilization Information of VM and Host by using VI SDK? Also how can i get the performance related data of CPU,Memory,Disk for a week, or month by using VI SDK in C#? I seen that under PerformanceManager ManagedObjectReference we have property name called historicalInterval. But which method i need to use for getting these info in C#?

Thanks

Sudhir Kumar

Reply
0 Kudos
2 Replies
admin
Immortal
Immortal

Hi Sudhir,

To fetch the performance data of a Virtual Machine or Host you need to use QueryPerf API, which requires Metric Ids to be passed. To know the metricId, use QueryAvailablePerfMetric API call. Please refer attached standalone C# sample, which takes Managed entity as input parameter and display values of cpu.usage counter.

- Seemanki

Reply
0 Kudos
c0d3p03t
Contributor
Contributor

Hi,

Just checking, is this still valid code? I am using it but getting some runtime errors. I have ESX 4.

Thanks!!

-c0d3p03t

Reply
0 Kudos