Created
September 8, 2017 12:27
-
-
Save gardart/639a17b524d0fb7c2668aa96ede1899a to your computer and use it in GitHub Desktop.
VMM-Performance-Status
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
# Export TOP X Performance statistics from VMM into a HTML table | |
$htmlfile = "c:\temp\status.html" | |
$firstx=10; # Select number of objects to list in the tables | |
# CSS style | |
$a = "<style>" | |
$a = $a + "BODY{background-color:peachpuff;}" | |
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}" | |
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}" | |
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}" | |
$a = $a + "</style>" | |
# Header for HTML with CSS | |
ConvertTo-HTML -head $a -body "<H1>TOP 10 Performance HITS</H1>" | out-file $htmlfile | |
# Get Performance data from VMM | |
ConvertTo-HTML -body "<H3>CPU Utilization</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object PerfCPUUtilization -Descending | select -First $firstx | Select-Object Name, VMHost, PerfCPUUtilization, PerfMemory | ConvertTo-Html | out-file -Append $htmlfile | |
ConvertTo-HTML -body "<H3>Memory Utilization</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object Memory -Descending | select -First $firstx | Select-Object Name,Memory,DynamicMemoryDemandMB,DynamicMemoryMaximumMB,DynamicMemoryEnabled | ConvertTo-Html | out-file -Append $htmlfile | |
ConvertTo-HTML -body "<H3>Network Utilization - Read Bytes</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object PerfNetworkBytesRead -Descending | select -First $firstx | Select-Object Name, VMHost, PerfNetworkBytesRead, PerfNetworkBytesWrite | ConvertTo-Html | out-file -Append $htmlfile | |
ConvertTo-HTML -body "<H3>Network Utilization - Write Bytes</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object PerfNetworkBytesWrite -Descending | select -First $firstx | Select-Object Name, VMHost, PerfNetworkBytesRead, PerfNetworkBytesWrite | ConvertTo-Html | out-file -Append $htmlfile | |
ConvertTo-HTML -body "<H3>Disk Utilization - Read Bytes</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object PerfDiskBytesRead -Descending | select –First $firstx | Select-Object Name, VMHost, PerfDiskBytesRead, PerfDiskBytesWrite | ConvertTo-Html | out-file -Append $htmlfile | |
ConvertTo-HTML -body "<H3>Disk Utilization - Write Bytes</H3>" | out-file -append $htmlfile | |
Get-SCVirtualMachine | Sort-Object PerfDiskBytesWrite -Descending | select –First $firstx | Select-Object Name, VMHost, PerfDiskBytesRead, PerfDiskBytesWrite | ConvertTo-Html | out-file -Append $htmlfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment