Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PixelRobots/348dc9dec8770a9687fb2f5089756340 to your computer and use it in GitHub Desktop.
Save PixelRobots/348dc9dec8770a9687fb2f5089756340 to your computer and use it in GitHub Desktop.
// Table of Servers with disk space is under nnGB
let setGBValue = 20;
// enter a GB value to check
let startDate = ago(30m);
// enter how many minutes 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
| summarize FreeSpace = (round(min(FreeSpaceGB))) by Computer, InstanceName
| where FreeSpace < setGBValue
| evaluate pivot(InstanceName, min(FreeSpace))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment