Skip to main content
< All Topics
Print

Disk drives running below 20 % free space within a week

To query the Performance Store database for disk drives that are running below 20 % free space within a week, use:

select d.*
from dbo.v_drive_predictions d
where d.hours_until_empty is not null
and d.hours_until_20_pct_free / 24 between 0 and 7
and d.sample_points >= 24
--and d.server_name = '[server_name]'
--and d.drive_letter = '[drive_letter]'
order by d.server_name, d.drive_letter

Forecasting is using a granularity of average disk space pr. hour with at least 24 sample points.

Forecasting is done for 3, 7 and 31 days. An alert is thrown when the average of the values for the 3 date intervals breaches the threshold.

20 % free disk space can have very different meaning depending on the size of the disk. To get an alert for 20 % free disk space of a 100 TB disk, would not make sense. Therefore the alert is only thrown in the following scenarios:

  • Disk size is less than 100 GB and free disk space is below 20 GB
  • Disk size is between 100 GB and 1 TB and free disk space is below 50 GB
  • Disk size is between 1 TB and 10 TB and free disk space is below 100 GB
  • Disk size is above 10 TB and free disk space is below 200 GB

To see the free space pr. sample point:

declare @dateInterval datetime = dateadd(day, -3, getutcdate()) -- the interval_period_days value can be 
retrieved from the query above
select dateadd(hour, datediff(hour, 0, c.sample_time), 0) sample_time, avg(c.free_space_mb) free_space_mb
from dbo.capacity c with (nolock)
where c.server_name = '[server_name]'
and c.drive_letter = '[drive_letter]'
and dateadd(hour, datediff(hour, 0, c.sample_time), 0) >= @dateInterval
group by dateadd(hour, datediff(hour, 0, c.sample_time), 0)
order by dateadd(hour, datediff(hour, 0, c.sample_time), 0)

The alert will be visible on the Latest stats dashboard.

To exclude specific servers from this alert, see how to use the dbo.team_alert_exclude table in Alerting.

Table of Contents