Wednesday, August 26, 2009

Bestiest Freeiest Solution - E-mail me when diskspace get's low

I was just talking with my co-worker, Brian, and he asked "Is there any easier way to monitor free disk space on my (Windows) servers?"

I then thought of the bestiest, freeiest solution and I thought I would share...

http://support.microsoft.com/kb/324796
Configure an alert with Windows Performance Logs and Alerts, then have it set to run a program to e-mail you.

"...
  1. Click Add to open the Add Counters dialog box.
  2. Click Select counters from computer, and then select your computer in the list.
  3. In the Performance object box, click LogicalDisk.
  4. Click Select counters from list, and then click % Free Space.
  5. Click Select interfaces from list, and then click the logical drive or volume that you want to monitor.
  6. Click Add to add the counter, and then click Close.
  7. In the Alert when the value is box, click Under, and then type the value that you want in the Limit box. For example, to trigger an alert message when disk space is under 1 megabyte (MB), type 1000.
  8. Accept the default value of 5 seconds in the Sample data interval, or specify the value that you want. (I'd suggest every 5 to 10 minutes, but it's up to you and your needs)
  9. Click Apply.
  10. Click the Action tab, and then specify... (a script to e-mail you about the disk space; I'll get to this further on).
  11. Click Apply.
  12. Click the Schedule tab, and then specify the start and stop parameters for the scan ...
  13. Click ok

..."

Make a script to e-mail you

If your using Windows 2003, you can easily right a .vbs script with Windows Script Hosting (WSH) language using CDO.Messages, but you're bumming if you try this on a 2008 server (or Vista). Then you should probably just go to Windows Powershell and write it with the system.net.mail.MailAddress class; your effort will pay off more better.

Conclusion

Freeiest, bestiest (blogged) solution :-)

No comments: