Last active
December 20, 2017 05:52
-
-
Save rchaganti/7d8d63b680bad4df384f728bb33b892f to your computer and use it in GitHub Desktop.
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
Start-UdDashboard -Content { | |
New-UdDashboard -Title "Performance Dashboard" -Color '#FF050F7F' -Content { | |
New-UdRow { | |
New-UdColumn -Size 6 -Content { | |
New-UdRow { | |
New-UdColumn -Size 12 -Content { | |
New-UdTable -Title "Server Information" -Headers @(" ", " ") -Endpoint { | |
@{ | |
'Computer Name' = 'NODE01' | |
'Operating System' = (Get-CimInstance -ComputerName NODE01 -ClassName Win32_OperatingSystem).Caption | |
'Total Disk Space (C:)' = (Get-CimInstance -ComputerName NODE01 -ClassName Win32_LogicalDisk -Filter "DeviceID='C:'").Size / 1GB | ForEach-Object { "$([Math]::Round($_, 2)) GBs " } | |
'Free Disk Space (C:)' = (Get-CimInstance -ComputerName NODE01 -ClassName Win32_LogicalDisk -Filter "DeviceID='C:'").FreeSpace / 1GB | ForEach-Object { "$([Math]::Round($_, 2)) GBs " } | |
}.GetEnumerator() | Out-UDTableData -Property @("Name", "Value") | |
} | |
} | |
} | |
} | |
New-UdColumn -Size 6 -Content { | |
New-UdRow { | |
New-UdColumn -Size 6 -Content { | |
New-UdMonitor -Title "CPU (% processor time)" -Type Line -DataPointHistory 20 -RefreshInterval 2 -ChartBackgroundColor '#80FF6B63' -ChartBorderColor '#FFFF6B63' -Endpoint { | |
try { | |
Get-Counter -ComputerName NODE01, NODE02 '\Processor(_Total)\% Processor Time' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty CounterSamples | Select-Object -ExpandProperty CookedValue | Out-UDMonitorData | |
} | |
catch { | |
0 | Out-UDMonitorData | |
} | |
} | |
} | |
New-UdColumn -Size 6 -Content { | |
New-UdMonitor -Title "Memory (% in use)" -Type Line -DataPointHistory 20 -RefreshInterval 2 -ChartBackgroundColor '#8028E842' -ChartBorderColor '#FF28E842' -Endpoint { | |
try { | |
Get-Counter -ComputerName NODE01 '\memory\% committed bytes in use' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty CounterSamples | Select-Object -ExpandProperty CookedValue | Out-UDMonitorData | |
} | |
catch { | |
0 | Out-UDMonitorData | |
} | |
} | |
} | |
} | |
New-UdRow { | |
New-UdColumn -Size 6 -Content { | |
New-UdMonitor -Title "Network (IO Read Bytes/sec)" -Type Line -DataPointHistory 20 -RefreshInterval 2 -ChartBackgroundColor '#80E8611D' -ChartBorderColor '#FFE8611D' -Endpoint { | |
try { | |
Get-Counter -ComputerName NODE01 '\Process(_Total)\IO Read Bytes/sec' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty CounterSamples | Select-Object -ExpandProperty CookedValue | Out-UDMonitorData | |
} | |
catch { | |
0 | Out-UDMonitorData | |
} | |
} | |
} | |
New-UdColumn -Size 6 -Content { | |
New-UdMonitor -Title "Disk (% disk time)" -Type Line -DataPointHistory 20 -RefreshInterval 2 -ChartBackgroundColor '#80E8611D' -ChartBorderColor '#FFE8611D' -Endpoint { | |
try { | |
Get-Counter -ComputerName NODE01 '\physicaldisk(_total)\% disk time' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty CounterSamples | Select-Object -ExpandProperty CookedValue | Out-UDMonitorData | |
} | |
catch { | |
0 | Out-UDMonitorData | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} -Port 10002 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment