Percentage Free DiskSpace or TotalDiskSpace

  • We want to monitor free disk space on the hard drives of our SQL Server boxes, but we want to do it by percentage of free space so that we can reuse the same monitor, regardless of the size of the hard drives on the box, and not have to create one-off monitors for each server.

    The xp_fixeddrives extended stored procedure will return the amount of free space on the servers drives in MBs.

    Is there a procedure that will return the Percentage of free space on each drive or, barring that, any procedure that will return the total size of each hard drive (or even one specified hard drive) and we can then do the calculation ourselves in a stored procedure?

    Thanks.

  • http://cwashington.netreach.net/depo/view.asp?Index=869

    I think I originally found this somewhere on SSC, but here is the link:

    It is not TSQL based, but can be modified to get what you want.

    -- Cory

  • Did this work for you?

    -- Cory

  • I've been working on other server builds and haven't had a chance to really dig into this, yet. I'm not sure I'll be able to use a non-TSQL solution but, as I say, I haven't had a chance to really look at this, yet. Thanks.

    🙂

  • Hi Edwin,

    This script will do it: http://www.sqldbatips.com/displaycode.asp?ID=4

    Cath

  • Cath,

    The script is great.

    Note to others, make sure that OLE Automation is enabled within SQL Server.

    "Key"
    MCITP: DBA, MCSE, MCTS: SQL 2005, OCP

  • Cath,

    Unfortunately we do not set up our SQL Servers with OLE Automation, so the script is not usable for us.

    Thanks, anyway.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply