I was wondering if there is an easy way to trigger an e-mail alert on Windows Server 2008 when any logical disk partitions become low on space. I have 2 SQL servers that have come close to running out of disk space because of the DB log files.

Thanks, Ryan


One simple way to get Windows Server 2008 to send low disk space e-mail alerts is to use Task Scheduler and the System Log. If the free space falls below the percentage specified in HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\DiskSpaceThreshold, an event is recorded in the System Log that can trigger a task to send an e-mail message.

  1. Open Task Scheduler and create a new task.
  2. Enter a name for the task, select "Run whether user is logged on or not", and check "Do not store password."
  3. Add a new trigger on the Triggers tab.
  4. Select "On an event" in the "Begin the task" box.
  5. Set Log to "System", Source to "srv", and Event ID to "2013".
  6. Add a new action on the Actions tab.
  7. Set Action to "Send an e-mail" and fill in the rest of the settings appropriately.
  8. To configure when the low disk space event is recorded in the System Log, open the Registry Editor, navigate to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and add a DWORD value named “DiskSpaceThreshold”, setting it to the desired percentage. When the entry does not exist, the default value is 10.

I added disk space monitoring via snmp to my (separate) nagios instance.


Why don't you run a powershell script as a schedule task every day? If the script find the free space of the disk is lower than 10%, it will send you an email or notification.

here is an example code for checking the free space of the disks:

Get-Content ForEach-Object { $; Get-WMIObject –computername $ Win32_LogicalDisk -filter "DriveType=3" | ForEach-Object { $.DeviceID; $.FreeSpace/1GB } }