My MVP Profile

Monday, December 18, 2006

Keeping and eye on the 'little things' with MOM 2005

On this, the 5th day of Christmas, I am a bit short on time, so I am going to give you a quick but handy script for website admins, plus follow up on yesterday's post regarding reporting on server attributes. I'll make it up with another management pack or two between now and Christmas.

This script, which will raise an event when the file count any one of multiple directories breaches a user defined threshold. was originally employed to keep an eye on file counts in IIS log directories on servers with many website. Seems like a little thing, but in this scenario we were dealing with log files in excess of 1GB per day per site! Doesn't take long to fill a drive at that rate.

The nice part about this script is that it accepts a comma-separated list of directories, so you can watch them all with one rule running this script. It could have been written to simply do a recursive parsing of subdirectories, but accepting the list accounts for multiple top level directories, etc.

PARAMETERS:
  • TargetDirs - Comma-separated list of directories to watch for file count.
  • LogSuccessEvent - Boolean value 1=LogEventOnSuccess 0=LogOnFailOnly
  • FileCountThreshold - Number above which file count threshold alert will be raised

Get it HERE:
http://www.momresources.org/momscripts/MaxFileCount.txt

Comments on "Keeping and eye on the 'little things' with MOM 2005"

 

post a comment links to this post