The scheme and the idea are very good. However, I will suggest improvement as:
1) make threshold parameter of the SP so you can change it on the agent job without altering SP
ALTER PROCEDURE dbo.usp_DBA_checkfordatabasefreespace
@threshold INT = 80
AS
2) it is comparing against the allocated space. In most databases, it is set as auto-grow. So the goal is really to alert on space remaining on the drive volume unless it is assuming the allocated database space is it.
CREATE TABLE #TMPFIXEDDRIVES (
DRIVE CHAR(1),
MBFREE INT)
INSERT INTO #TMPFIXEDDRIVES EXEC xp_FIXEDDRIVES
3) besides system database, you might want to consider online database only, not read-only, ....
FROM sys.databases
WHERE
name NOT IN ('master', 'model', 'msdb', 'tempdb', 'ADMINDB', 'Distribution') AND
name NOT LIKE '%ReportServer%' AND
DATABASEPROPERTYEX([name], 'IsInStandBy') = 0 AND
DATABASEPROPERTYEX([name], 'Status') = 'ONLINE'
Jason
http://dbace.us
😛