In this blog post I’m going to explain how to monitor your disk-space and getting an email notification when the disk space is below a certain value. I know that you can use System Center Operations Manager for these kind of tasks but it is a expensive tool for small Businesses and you need quid a lot of knowledge to get it working properly. We need the following tools:
- WevUtil
- Windows Performance Monitor
- Event Viewer
- Task Scheduler
Wevutil Script
- Create a batch file with the following lines:
Configuring the Windows Performance Monitor
- Start the Performance Monitor
- Navigate to "Data Collector Sets" and right click "User Defined"
- Click "New", "Data Collector Set"
- On the "Create new Data Collector Set" page, name the set "Free Disk Space Available" and select "Create Manually (Advanced)". CLick "Next"
- Select "Performance Counter Alert" and click "Next"
- Click "Add"
- In the "Available counters section, select "LogicalDisk" and then select "Free Megabytes". In the "Instances of the selected Object’s" section, select the drive you wish to monitor and click "Add". Click "OK"
- On the "Create new Data Collector Set" page, select alert when "below" limit "5000" and click "Next" (In my example I will use 80000 for the alerting check)
- select "Save and Close" and click "Finish"
- Navigate to "Data Collector Sets – User Defined – Free Disk Space Available" and select "DataConnector01"right click "properties"
- On the "DataCollector01 Properties" page, select the tab "Alert Action"
- On the "Alert Action tab, check "Log an entry in the application event Log". On the "Start data collector set section, select "Free Disk Space Available"
- Click "Apply" and "Ok
- Navigate to "Data Collector Sets – User Defined " and right click "Free Disk Space Available" and click "Start"
(Optional)Adding multiple dataConnectors to the Data Collector Set:
- Navigate to "Data Collector Sets – User Defined " and right click "Free Disk Space Available " and click "Stop"
- On the "Action" page, richt click and select "New" and click "Data Collector"
- On the "Create New Data Collector" page, name the data collector "DataCollector02" and select "Performance counter Alert" and click "Next"
- Click "Add"
- In the "Available counters section, select "LogicalDisk" and then select "Free Megabytes". In the "Instances of the selected Object’s" section, select the drive you wish to monitor and click "Add". Click "OK"
- On the "Create new Data Collector Set" page, select alert when "below" limit "5000" and click "Next"
- Click "Finish"
- Navigate to "Data Collector Sets – User Defined – Free Disk Space Available" and select "DataConnector02"right click "properties"
- On the "DataCollector01 Properties" page, select the tab "Alert Action"
- On the "Alert Action tab, check "Log an entry in the application event Log". On the "Start data collector set section, select "Free Disk Space Available"
- Navigate to "Data Collector Sets – User Defined " and right click "Free Disk Space Available" and click "Start"
Check and configure the Event Viewer
- Start the Event Viewer
- Navigate to "Applications and Services Logs – Microsoft – Windows – Diagnosis-PLA – Operational and you can see that event "2031" is logged. For demonstration purpuses I changed the percentage to 50.
- Right click on the event and click "Attach Task to this Event"
- On the "Create A Basic Task section, name the task "Free Disk Space Email Alert" and click "Next"
- On the "When an Event is Logged section, click "Next"
- On the "Action section, select "Send an E-mail and click "Next"
- On the "Send an Email section, fill in the following:
- Click "Finish"
- Open the "Task Schedular" page, select "Event Viewer Tasks" an right click the created task and select "Properties"
- Select "Actions" tab and click "New"
- Click "Browse" and select the script that you created. Click "OK"
- Move the "Start a Program" to the top of the list and click "OK"
- When the Configuration is finished. You should get an e-mail looking like this:
Configure the Scheduled task to run on Startup
Hopefully the above steps will help you to configure disk space alert notifications. If you have a question feel free to contact me