I’ve created a nice little tool I’m using more and more. As a BizTalk Administrator, I’m constantly needing to ensure nothing is going wrong on my servers. I need an alert process that could email me if/when there is a problem. I’ve created an event log monitoring tool that will email me depending on the search criteria I specify. I’ve included a feature that allows me to create multiple emails depending on the exact error. I use this quite a lot if a specific user needs to only know about their particular error.

The program is a single executable.

It is executed via the command prompt and takes the following parameters, which can be in any order.

-TOEMAIL: = ToEmail (Required) Can include multiple To Email addresses.
-FROMEMAIL: = FromEmail (Required)
-SMTPSERVER: = SmtpServer (Required)
-NUMBEROFDAYS: = Number of Days to look back (Optional) if not set to today’s data
-NUMBEROFHOURS: = Number of Hours to look back (Optional) if not set will use -NUMBEROFDAYS
/n = Send Email if there are no events (Optional)
/e = Send Errors (Optional)
/w = Send Warnings (Optional)
/i = Send Information (Optional)
-EVENTSOURCE: = Event Source (Optional) Can include none or multiple Event Sources to include in the search
-EVENTCATEGORY: = Event Category (Optional) Can include none or multiple Event Categories to include in the search
-EVENTMESSAGESEARCHSTRING: = Event Message Search String (Optional) Can include none or multiple Event Message Strings to include in the search

I usually set up a batch file that is run on the Windows Scheduler and sends me an email every night for the previous day’s information.

For example, I have the following event log:

I would like to receive an email for all the Events of Type Errors in the “BizTalk Server 2006” Category over the last 5 days. I would execute the following command at the command prompt:

“Generic Event Log Emailer.exe” -TOEMAIL:jstott@stottcreations.com -FROMEMAIL:MYBIZTALKERRORS@Biztalkerrors.com -SMTPSERVER:yoursmtpserver.com

-NUMBEROFDAYS:5 “-EVENTCATEGORY:BizTalk Server 2006” /e

Alternatively, I would just create a batch file with that string and schedule it to execute every 5 hours.

I then get an email every 5 hours with all the information I’m looking for.

Don’t forget that you can also search using the -EVENTMESSAGESEARCHSTRING: parameter. Using this parameter, you can really narrow down your search to specific messages.

Here are my list of planned upgrades:

1. Add regular expressions to the -EVENTMESSAGESEARCHSTRING: parameter

2. Add -EXCLUDE parameters to allow you to exclude Source, Categories, or Messages instead of only including.

3. Add the other Event Logs besides the Application Event Log.

4. Create a real time monitoring tool that would push errors to you as they happen instead of pulling them at certain intervals.

If you have any other features you’d like to see in this product, please email me.