Selamat Tahun Baru 2013 "

Banner

Kamis, 13 Desember 2012

Low Disk Space Notifications via Email in Windows Server 2003

this article will assist you in configuring a performance monitor to notify you via email when disk space is below a specified threshold.

Enable SMTP Authentication

The first thing you need to do is ensure you have an SMTP server available for sending the notifications. The following support article walks you through configuring SmarterMail for allowing relay through localhost without any authentication.

Install and Configure Blat

Blat is a 3rd party utility we will install that performs the SMTP communication through the command line.
  1. Download Blat
  2. Click Open
  3. downloadblat262complete
  4. Unzip blat to c:\windows\system32
  5. unzipblat262
    extractblat262
  6. Open a command prompt, Start -> Run -> cmd
  7. startruncmd
  8. Change directory to blat installation, c:\windows\system32\blat262\full
  9. Configure blat to relay on localhost; blat -install localhost root@mydomain.com
      You can specify the from address here; ie root@mydomain.com
  10. configureblat262

Create a Batch Script to Send Email

  1. Open Notepad, Start > Run > notepad
  2. runnotepad
  3. Enter the following text; replace notifyaddress@yourdomain.com with the address you want to receive the notifications TO
      C:\WINDOWS\system32\blat262\full\blat.exe - -body "You are approaching your disk limit" -t notifyaddress@yourdomain.com -s "Disk Limit"
  4. Save As c:\windows\system32\emailblat.bat, be sure to Save as type: All Files
  5. saveasemailblatbat

Create the Performance Monitor Alert

  1. Start -> Administrative Tools -> Performance
  2. adminperformance
  3. Expand Performance Logs and Alerts
  4. Right Click on Alerts and select New Alert Settings
  5. newalertsettings
  6. Enter a name for the New Alert Setting, ie Free Disk Space
  7. newalertsettingsname
  8. Click OK
  9. Under comment enter a description for this alert
  10. freediskspacecountercomment
  11. Click Add
  12. Under Performance Object select Logical Disk
  13. Select % Free Space from the counters list
  14. Click Add
  15. Click Close
  16. addcounters
  17. Change Alert when the value is to Under and set the Limit to the numeric value where you wish to be notified, ie 500 would be 500Mb
  18. Change Sample Data every to the interval you wish to use for checking and receiving notifications
  19. valuelimit
  20. Select the Action Tab
  21. Check run this program
  22. Click Browse and navigate to the emailblat.bat you created in c:\windows\system32\
  23. runthisprogram
  24. Click Apply
  25. Set the user to run under, generally this will be your root user and password
  26. setpassword
  27. Click OK

0 komentar:

Posting Komentar