VMware Cloud Community
cmichals
Contributor
Contributor

Powercli to gather stats on every Cluster in a vCenter

I am having a heck of a time creating a csv with 3 stats for every cluster in a vCenter.  I want to do every 2 hours for the past 30 days.  I can gather each stat separately and export them to a csv, but having an issue getting all 3 stats into the same csv.  Here are the 3 stats I want:  'cpu.usagemhz.average','mem.usage.average','mem.consumed.average'   Here is a sample of what I am looking for (I have taken out my vcenter and clustername:

VC Name Sampletime Cpumhz Memusage % MemConsumed gb
vcenternameclustername4/4/202111144929.7151369.216423
vcenternameclustername4/4/2021 2:0010825929.7316661370.096066
vcenternameclustername4/4/2021 4:0011509629.7483331370.894335
vcenternameclustername4/4/2021 6:009833129.6751367.481006
vcenternameclustername4/4/2021 8:009316329.6351365.609774
vcenternameclustername4/4/2021 10:009940729.6233331365.009445
vcenternameclustername4/4/2021 12:008394429.631365.297879
vcenternameclustername4/4/2021 14:007843229.6333331365.449091
vcenternameclustername4/4/2021 16:008003229.6333331365.489316
vcenternameclustername4/4/2021 18:008128329.6333331365.462708
vcenternameclustername4/4/2021 20:008110529.6583331366.595776
vcenternameclustername4/4/2021 22:009611129.7033331368.880851
Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

It would help if you showed the code you are currently using.

In fact, if you connect to all the targetted vCenters, you can probably use nearly the same code.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos