Disk drives running empty within a week

How can we help?
< All Topics
Print

Disk drives running empty within a week

To query the Performance Store database for disk drives that are running empty within a week, use:

select d.*
from dbo.v_drive_predictions d
where d.hours_until_empty is not null
and d.hours_until_empty / 24 between 0 and 7
and d.sample_points >= 24
and d.server_name = '[server_name]'
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 value for the 3 date intervals breaches the threshold.

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.post_time), 0) sample_time, avg(c.free_space_mb) free_space_mb
from dbo.v_capacity c with (nolock)
where c.server_name = '[server_name]' -- without instance name or port number
and c.drive_letter = '[drive_letter]'
and dateadd(hour, datediff(hour, 0, c.post_time), 0) >= @dateInterval
group by dateadd(hour, datediff(hour, 0, c.post_time), 0)
order by dateadd(hour, datediff(hour, 0, c.post_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