Home > MOM > MOM 2005: How can I monitor the number of files in a folder and collect the value as performance data?

MOM 2005: How can I monitor the number of files in a folder and collect the value as performance data?

Are you still using MOM 2005?  Has anyone approached you with this request? 

If you did, then I had this same question from our team who manages CA Message Manager.  They wanted to be able to get a real count of files in message queue folders, set thresholds on the number of files, age of the files, and create performance data for trending.

In the past I was using a old MOM 2000 script from a NetIQ consultant (Ugo Corti) to do this.  However, as we progressed more and more towards using MOM 2005 as our one stop shop for monitoring, the CA Message Manager group needed something a bit better.  This older script wasn’t going to work as they liked.

Knowing that there are great resources on the net for MOM 2005 (and SCOM) scripts I decided to check them out and found a great script by Pete Zerger.  The script I am talking about is called “ App Dir and Queue Monitoring (MOM 2005) ”.

I imported this script into my MOM 2005 labs and started testing.  It worked as expected except for the performance collection portion.  Performance objects were being created and collected, but the value was always “0”.  I asked Pete about this and he was very helpful in troubleshooting the issues I was having (despite the ribbing I was giving him about this old script). 

He wanted me to have someone else test the script in there lab to see if the results were the same, so as to rule out my environment.  So that brings us to Scott Moss.  Scott, like me, still has MOM 2005.  Scott, unlike me, happens to actually know Visual Basic along with many other things (like top 10 famous midget wrestling matches, how many licks it takes to get to the center of a tootsie pop, etc).  So tonight he was kind enough to give me a hand with this issue and guess what?  He fixed it!  I could have said I fixed it, but I’d like to say I was his muse to get this script working.

Anyway, if you need this script and want the performance data to be processed and collected correctly by MOM 2005, then all you need to do is make a minor cut and paste:

Area of the Original Script that needs to be modified:


Area of the Original Script after modification:


Once you do this, then the number of old files in the folder that you are monitoring will be logged correctly in your performance view.

Thanks again to Pete and Scott (as well as a few others) for all the help with this issue!  If you haven’t added their blogs to your RSS readers, then I highly recommend you do so!  Also, you can visit both of them in Las Vegas next week as they will both be attending MMS.  Give them a hug for me!

Categories: MOM
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: