Monitoring NEtwork shares drive space using SQL

  • Hi All,

    I was wondering whether there is a script/way out there in which one can monitor disk space on a network shared drive, I know once can use xp_fixeddrives, but this is mainly for local drives on the actual server.

    Does anyone have a solution for this problem, the network drive can be mapped onto the operating system.

  • Dean Jones (12/2/2008)


    Hi All,

    I was wondering whether there is a script/way out there in which one can monitor disk space on a network shared drive, I know once can use xp_fixeddrives, but this is mainly for local drives on the actual server.

    Does anyone have a solution for this problem, the network drive can be mapped onto the operating system.

    see the link:

    http://www.sqlservercentral.com/Forums/Topic113227-5-1.aspx

    http://www.databasejournal.com/features/mssql/article.php/3080501/Using-xpfixeddrives-to-Monitor-Free-Space.htm

  • Kishore.P (12/2/2008)


    Dean Jones (12/2/2008)


    Hi All,

    I was wondering whether there is a script/way out there in which one can monitor disk space on a network shared drive, I know once can use xp_fixeddrives, but this is mainly for local drives on the actual server.

    Does anyone have a solution for this problem, the network drive can be mapped onto the operating system.

    see the link:

    http://www.sqlservercentral.com/Forums/Topic113227-5-1.aspx

    http://www.databasejournal.com/features/mssql/article.php/3080501/Using-xpfixeddrives-to-Monitor-Free-Space.htm

    These 2 links don't seem to support Network Drives space? as far as I can read...

    OP did mention xp_fixeddrives as well, but that only works for local drives of the SQL server

    OP is probably asking if we can check space on a UNC path, or a Network-mapped drive... which I am curious too as well

    SQLServerNewbieMCITP: Database Administrator SQL Server 2005
  • Conceal this extended SP into a SP, the call that SP from a linked server, this can be used with the machine where we have SQL installed 🙂

  • Hi Guys,

    Yes, I mean a UNC path either directly or mapped onto a computer, not sure which one will be easier but just one way or the other really.

    thanks.

  • You won't be able to directly monitor the free space of a share within SQL Server.

    What you could do is create a Performance Counter Log to record the appropriate free space counter from the remote server. Then you can use Logman.exe to load that data into a SQL Server database. Once there you can track it and raise notifications about low space.

    --------------------
    Colt 45 - the original point and click interface

  • You can monitor network share space very simply. Just use the DIR \\sharename cmd and the last value is free space 🙂

    EG.

    DECLARE @cmd VARCHAR(2000)

    SET @cmd = 'DIR "\\SHARENAME"'

    EXEC xp_cmdshell @cmd

  • Knight (10/8/2015)


    You can monitor network share space very simply. Just use the DIR \\sharename cmd and the last value is free space 🙂

    EG.

    DECLARE @cmd VARCHAR(2000)

    SET @cmd = 'DIR "\\SHARENAME"'

    EXEC xp_cmdshell @cmd

    Firstly, is there any particular reason you're replying to a six year old thread?

    Secondly, xp_cmdshell is generally disabled in the majority of SQL Server instances due the security risks that it exposes.

    --------------------
    Colt 45 - the original point and click interface

  • xp_cmdshell being disabled is a matter of choice and frankly overkill. You can simply enable it, use it and disable it if security folks are that paranoid. I've worked at many many places and only seen it disabled in 1...

    And I found this post via google when looking in to the issue of getting information for network shares via SQL. OK

Viewing 9 posts - 1 through 8 (of 8 total)

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