Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232869

Re: Real time CPU and Memory Utilization report of all ESX Host...

$
0
0

Sure, try it like this

 

 

$entity=  Get-VMHost
$counter="cpu.usage.average","mem.usage.average"$report=@()Get-Stat-Entity$entity-Stat$counter-Realtime-MaxSamples1|Group-Object-Property {$_.Entity.Name} |%$report+=New-ObjectPSObject-Property@{    Name=$_.Name
    State=$_.Group[0].Entity.ConnectionState
    Time=$_.Group[0].Timestamp
   
CPU="{0:P2}"-f (($_.Group|where {$_.MetricId-eq"cpu.usage.average"-and$_.Instance-eq""} |Select-ExpandPropertyValue)/100)    Memory="{0:P2}"-f (($_.Group|where {$_.MetricId-eq"mem.usage.average"} |Select-ExpandPropertyValue)/100)  } }$report|Export-Csv-Path$env:Temp\report.csv-NoTypeInformation-UseCulture|Out-NullSend-MailMessage-From"luc@lucd.info"-To"luc@lucd.info"`
 
-Subject"ESXi stats"-SmtpServermail.lucd.info-Attachments$env:Temp\report.csv 

Viewing all articles
Browse latest Browse all 232869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>