Using ColdFusion to check available disk space

I mentioned this in a presentation last week but I thought I’d bring it up with a concrete example. For those of you who allow file uploads to your server, how many of you actively check your free space on your server? Even if you don’t use that feature, do you monitor free space anyway? Log files, in particular, can suck up quite a bit of space. Here is an incredibly simple ColdFusion template that checks for a minimum number of gigs of free hard drive space. If it is less than that threshold, or at 0, which didn’t happen to me yesterday, honest, then it fires off an email.

Set this up to run hourly and you should be good to go. You could also make this check multiple drives if your server makes use of them.

So yeah -this so didn’t bite me in the ass. Honest.