Monitoring Drive Space on OS drives

Luke LLuke L Posts: 37 Bronze 2
edited January 22, 2016 10:07AM in SQL Monitor Previous Versions
Is anyone else out there monitoring drive space differently for OS drives than for data/log drives?

We are able to setup exclusions for the OS drive from the norm on a per machine, per drive basis, but I'm looking for a way to manage all of my OS drives at one percent free or GB free level differently than my data, log and tempdb drives.

Example, most of my C drives maintain a fairly static 15%-25% free, but my Data/Log/backup drives typically have a larger % free space. We have a standard to throw a disk space alert for all drives when they are less than 25%, however for the C drives, we expect them to typically be lower than 25%.
Instead of editing each machine (we have 28 monitored by SQL monitor) and setting the disk space for the C drive, does anyone know how I can set a standard for all of my C drives and apply that to all of my monitored instances?

Thanks,
-Luke.

Comments

  • Hi Luke,

    There is currently no way to do this wtihin SQL Monitor. Even if you were able to select multiple disks at the same time you are only able to edit whether they are enabled or disabled and their email settings. I would go to the SQL Monitor Uservoice and raise a suggestion for others to vote upon!

    Outside of SQL Monitor you can use this script I've managed to magic up to find all the C: drive Id's and insert a custom alert configuration for each directly into the database using a cursor. You need to run this on the data repository - RedGateMonitor by default. The XML for the third value is expanded out below the query so you can see where you need to edit the options more clearly to get customised to what you want.


    THIS IS NOT SUPPORTED - USE AT OWN RISK
    DECLARE @diskID int
    
    DECLARE MY_CURSOR CURSOR 
      LOCAL STATIC READ_ONLY FORWARD_ONLY
    FOR 
    SELECT DISTINCT Id FROM [RedGateMonitor].[data].[Cluster_Machine_LogicalDisk_Keys] WHERE _Name = 'C:'
    
    OPEN MY_CURSOR
    FETCH NEXT FROM MY_CURSOR INTO @diskID
    WHILE @@FETCH_STATUS = 0
    BEGIN 
        INSERT INTO [RedGateMonitor].[config].[Cluster_Machine_LogicalDisk_AlertConfiguration]
    	-- values(Id, _AlertType (9 is disk space alert), _Configuration (see XML below), _Enabled (0 no, 1 yes), _AlertNotification (1 for default, 2 for custom email), _EmailAddress (custom email address, blank if default), _Version(ignore), _SubType(ignore)
    	VALUES(@diskID, 9, '<Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><HighTimeSpan>120</HighTimeSpan><HighEnabled>true</HighEnabled><MediumTimeSpan>120</MediumTimeSpan><MediumEnabled>true</MediumEnabled><LowTimeSpan>120</LowTimeSpan><LowEnabled>true</LowEnabled><HighThreshold>0.8</HighThreshold><MediumThreshold>0.75</MediumThreshold><LowThreshold>0.70000000000000007</LowThreshold><HighCondition>AbsoluteOnly</HighCondition><MediumCondition>AbsoluteOnly</MediumCondition><LowCondition>AbsoluteOnly</LowCondition><HighAbsoluteThreshold>419430400</HighAbsoluteThreshold><MediumAbsoluteThreshold>838860800</MediumAbsoluteThreshold><LowAbsoluteThreshold>1073741824</LowAbsoluteThreshold></Config>', 1, 1, '[email protected]',0,0)
        FETCH NEXT FROM MY_CURSOR INTO @diskID
    END
    CLOSE MY_CURSOR
    DEALLOCATE MY_CURSOR
    
    THIS IS NOT SUPPORTED - USE AT OWN RISK


    This is the default XML when you click customise - The 120 is the "For longer than 120 seconds" at the bottom. Both the "Threshold" percentages (i.e. .8, .75 and .7000...) and the "AbsolutThreshold" size values (size is in Bytes, 400MB = 419430400 Bytes (400*1024*1024)) are shown, the choice between them is done by changing "AbsoluteOnly" for "PercentOnly", make sure all three are the same.
    <Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <HighTimeSpan>120</HighTimeSpan>
      <HighEnabled>true</HighEnabled>
      <MediumTimeSpan>120</MediumTimeSpan>
      <MediumEnabled>true</MediumEnabled>
      <LowTimeSpan>120</LowTimeSpan>
      <LowEnabled>true</LowEnabled>
      <HighThreshold>0.8</HighThreshold>
      <MediumThreshold>0.75</MediumThreshold>
      <LowThreshold>0.70000000000000007</LowThreshold>
      <HighCondition>AbsoluteOnly</HighCondition>
      <MediumCondition>AbsoluteOnly</MediumCondition>
      <LowCondition>AbsoluteOnly</LowCondition>
      <HighAbsoluteThreshold>419430400</HighAbsoluteThreshold>
      <MediumAbsoluteThreshold>838860800</MediumAbsoluteThreshold>
      <LowAbsoluteThreshold>1073741824</LowAbsoluteThreshold>
    </Config>
    

    I hope that helps!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.