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

Get-stat with hung vm cpu process

$
0
0

I am thinking to produce a daily report of vms with hung process -  vms with an average of cpu utilization 80%+ over the last 4 fours is a sign and needs to be look up.

 

This script will kick off everyday at 5am and sweep 500+ vms, is there anything else I should put in the consideration?

 

 

$vm = "abcd"

$statcpu = Get-Stat -Entity $vm -Stat cpu.usage.average -Start (Get-Date).AddHours(-4) -Finish (Get-Date).AddHours(-0)

$Avgcpu = $statcpu | where {$_.Value -ne 0} | Measure-Object -Property value -Average -Maximum | select Average

if ($Avgcpu.Average -gt 80) {write-host $vm}


Viewing all articles
Browse latest Browse all 168400

Trending Articles



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