{"name":"Percentage of database free space","description":"This metric measures the percentage of database free space - both reserved and unused - to help you manage space requirements more efficiently. For example, you might find this data helps you to correctly estimate file size, so you don't suffer from problems associated with automatic file growth.","tsql":"SELECT (AU.unallocated + AU.unused) * 100 \/ (AU.reserved + AU.unallocated) AS free_space_pct\r\n  FROM (SELECT AU.reserved,\r\n               AU.reserved - AU.used AS unused,\r\n               CASE WHEN SF.db_size >= AU.reserved THEN (SF.db_size - AU.reserved) ELSE 0 END AS unallocated\r\n          FROM (SELECT SUM(CAST(CASE WHEN SF.status & 64 = 0 THEN SF.size ELSE 0 END AS DECIMAL(38, 2))) AS db_size\r\n                  FROM dbo.sysfiles AS SF) AS SF\r\n               CROSS JOIN\r\n               (SELECT SUM(CAST(A.total_pages AS DECIMAL(38, 2))) AS reserved,\r\n                       SUM(CAST(A.used_pages AS DECIMAL(38, 2))) AS used\r\n                  FROM sys.partitions AS P\r\n                       INNER JOIN\r\n                       sys.allocation_units AS A\r\n                       on A.container_id = P.partition_id) AS AU) AS AU;","instances":true,"frequency":1800,"databases":{"mode":0},"rateofchange":false,"metricenabled":true,"alertname":"Low database free space","alertdescription":"The amount of free space for this database (including reserved and unused space) is low.","aboveorbelow":"below","collections":3,"alertenabled":true,"_thresholds_high":{"selected":true,"value":10},"_thresholds_medium":{"selected":true,"value":20},"_thresholds_low":{"selected":true,"value":30},"thresholds_comment":"Note: These thresholds are intended as guideline values. If they seem too high or too low for your environment, replace them with values more suited to your server performance. ","frequency_comment":"Note: If this frequency is too low or too high for your needs, choose an alternative option. ","targetentitytype":0}