Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Chart disk if its under nnGB over the past nn days
let setGBValue = 20;
// enter a GB value to check
let startDate = ago(2d);
// enter how many days to look back on
Perf
| where InstanceName != "D:" and InstanceName contains ":"
| where TimeGenerated > startDate
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"
| extend FreeSpaceGB = CounterValue/1024
| extend compDrive = strcat( tostring( Computer ), "/", tostring( InstanceName ) )
| summarize FreeSpace = min( FreeSpaceGB ) by compDrive
| where FreeSpace < setGBValue
| summarize max(FreeSpace) by compDrive
| join
(
Perf
| where TimeGenerated > startDate
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"
| extend FreeSpaceGB = CounterValue/1024
| extend compDrive = strcat( tostring( Computer ), "/", tostring( InstanceName ) )
)
on compDrive
| make-series FreeSpace = min( FreeSpaceGB ) on TimeGenerated from startDate to now() step 4h by compDrive
| render timechart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.