Disk Space Usage Trend Analysis – Part 1

green

Traditionally, alerting on disk space usage at say 90% or 95% has been the way to “proactively” resolve disk space issues before they become critical.  Of course these arbitrary figures don’t often fit the mould and our proactive alerts make us more reactive than anything else; scrambling to delete/compress/archive files and as a last resort expanding virtual disks.

Then what happens if there is no more space available on the SAN and you’re waiting weeks (or months) for new hardware? Inevitably someone will ask “why didn’t you know ahead of time this was going to happen?”

This is Part 1 on how to develop a sophisticated report for predicting (as best as possible) when your servers hard disks are going to run out of space, and hopefully gain better insight into disk growth, and reach the ultimate goal of capacity management.

After this is complete, you will be able to confidently answers questions like:

  • What is the rate of change for each servers hard disks? How much are they growing by each day?
  • At its current growth rate, in how many days will the disk run out of space?

The broad strokes of this solution are:

  • Collect disk space usage, once per day, for all servers over a period of time. (Part 1)
  • Using the data collected, develop a trend line. (Part 2)
  • Create graphs of the usage and usage trend. (Part 3)

So at the end of Part 3, you should end up with something that looks like this:

BK02_C_150514

To begin, the below script should be run as a scheduled task (at the same time every day) and will collect disk usage across all servers in your domain.  Here’s how to create a Schedule Task to run a PowerShell script.

 

After the above script runs, you’ll end up with files like those below in c:\scripts\disklog (one for each server/drive combination):

disktrend1

After several days of this script being run, each csv/txt file will look like the below (each line has the date and the disk space used in GB):

disktrend2

 

In Part 2, we will look at creating a second script to take the data collected and calculate a trend line to determine the average rate of change and try and predict when the disk will run out of space.

green

1 Comment Disk Space Usage Trend Analysis – Part 1

Leave a Reply

Your email address will not be published. Required fields are marked *