Created
January 5, 2018 06:06
-
-
Save smallsam/1ff27744785a440f72671a4891ad8f86 to your computer and use it in GitHub Desktop.
Find ESX hosts with high storage path latency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add-pssnapin vmware* | |
connect-viserver vcenter | |
$start = (get-date).AddMinutes(-60) | |
$metric = "storagePath.totalWriteLatency.average" | |
$report = @() | |
$vmhosts = Get-VMHost | |
$stats = Get-Stat -Realtime -Stat $metric -Entity $vmhosts -Start $start | |
$report = $stats | Group-Object -Property {$_.Entity.Name} | %{ | |
New-Object PSObject -Property @{ | |
Host = $_.Name | |
LatencyMax = ($_.Group | ` | |
%{$_.Value} | ` | |
Measure-Object -Maximum).Maximum | |
} | |
} | |
$report | export-csv -NoTypeInformation -Path c:\temp\esx_pathlatency.csv | |
$report |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment