Created
August 26, 2019 11:01
-
-
Save PixelRobots/6f11c6752e06ec544ad126c6152f295e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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