Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Monitoring Disk Space Using an Alert

$
0
0

I am on SQL Server 2012.  It is installed on a VM.  I would like to create an alert that monitors the disk space on a drive.  I would like to monitor Drive D when the free space drops below 3GB.  I have put below the below code but it doesn't seem to be working. 

USE [msdb]
GO

/****** Object:  Alert [Low disk - Drive D]    Script Date: 6/14/2013 2:55:23 PM ******/
EXEC msdb.dbo.sp_add_alert @name=N'Low disk - Drive D',
  @message_id=0,
  @severity=0,
  @enabled=1,
  @delay_between_responses=0,
  @include_event_description_in=0,
  @notification_message=N'Low Disk Space on Drive D:\ on Server:  ServerNameHere',
  @category_name=N'[Uncategorized]',
  @wmi_namespace=N'\\.\root\CIMV2',
  @wmi_query=N'SELECT * FROM __InstanceModificationEvent WITHIN 1 WHERE TargetInstance ISA ''Win32_LogicalDisk'' AND TargetInstance.FreeSpace < 3221225472  AND TargetInstance.DeviceID = ''D:''',
  @job_id=N'00000000-0000-0000-0000-000000000000'
GO


lcerni


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>