Thursday, May 17, 2012

How To Configure Disk Space Alerts on Server 2008

Some of us may not have access to enterprise level third party tools like What's Up Gold that will do server monitoring. Luckily, Microsoft has built in some tools to handle this for you.

The general premise is to set up a new data collector set with the Reliability and Performance Monitor that will kick off an automated email via a scheduled task letting you know the disk space on your server is nearly full.


First open up your server manager on your 2008 Windows Server. Navigate to your Reliability and Performance monitor. Create a new User Defined collector set by right clicking the User Defined option.


Select  Create manually (advanced) and Name your collector set. In my case I am calling this "Disk Space Check".


Select Performance Counter Alert


Now we need to add a performance counter to the data collector properties. Right click the DataCollector01 under your new user defined "Disk Space Check"  and select Properties.

Now click Add. Locate and add the % Free Space variable and ensure it is checking for the drive you wish to monitor. In Most cases this will the c: drive.


Click OK and adjust your alert threshold. I aim to have the server alert me when free space on the c: drive drops to 3% or below and I'd like it to check every fifteen minutes.



Now select the Alert Task tab and enter in "diskalert" (with no quotes) in the first field labeled, "Run this task when an alert is triggered". You can also choose to log this alert in the event log via the Alert Action tab if you so choose. The alert task you enter in needs to be duplicated when we make the actual task. You must use the same name.

Click OK to accept the changes and now:

Right Click on your "Disk Space Check" item under User Defined data collector sets. Select the Directory tab and chagne the Root directory to your preference. You may want to change name formatting  of the subdirectory as I have. Selecting the arrow to the write of the input field will give you an easy way of doing so.


Now select the Schedule tab and add a new schedule. I set mine up to run every day starting today with no expiration.




Now let's create our actual task that will run when the event is triggered and the alert is set off. Again, be sure you matched the Alert Task field and the name of this new task.


Now select the Actions Tab and create a new Action. In the new window select Send an Email and fill in the appropriate information for your environment as I have.



You may want to manually run this new task from the task library to ensure you will get an email. 


And that's it. Now just in case your disk space runs out on your server's drive due to a corrupt backup job or a full transaction log you will be notified before your services start to shut off from lack of disk space. Enjoy!

9 comments:

  1. Never runs. No emails are ever sent. Task Scheduler shows error 202...? The Google Oracle shows many people have this issue. Perhaps something with the mail server?

    ReplyDelete
  2. Not sure without more details about your setup, this has been working flawless for me on multiple systems.

    ReplyDelete
  3. I wish to give out the reason why We quit the server jobs employment after that long in addition to earn money was able to find the money for that.

    ReplyDelete
  4. is there a way to do the same for mounted UNC network folders

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Hi Jim

    I can't have a connection between Disk Space Check and the task Scheduler. How does Task Scheduler know that this is coming from Disk Space Check? Even tho I have it same name in the Task Scheduler. Am I missing something here?

    Thanks

    ReplyDelete