Disks volume capacity alert thresholds based on volume size
- 16 days ago
It's been brought up a few times in the forums over the years. Your thought should work and might be the easiest but I personally would look to make a DataSource change to keep it a bit cleaner. I do see a Community DataSource called "WinVolumeUsageConditional-" that seems to implement something along these lines. Might be worth looking at or atleast using it for inspiration. Basically it uses Complex datapoints to provide more datapoints based on conditions that you can alert on.
I personally don't like to hard code thresholds directly into the DataSource, so I would do something more like LargeDrivesFreeSpaceGB=if(gt(AvailableGB,1024),FreeSpaceGB,unkn()) and SmallDrivesFreeSpaceGB=if(le(AvailableGB,1024),FreeSpaceGB,unkn()) so you can set thresholds differently if the drive is small vs large. Note that I didn't test these and just off the top of my head.
Also keep in mind that thresholds can be real numbers, so you can set thresholds to like >=98.1531%