BizTalk Health Email Alerting Part 1: Active Messages

In this multipart serie of blogposts, I will try to give some examples to keep an eye on the monitoring of BizTalk, without having the need to log on to the environment. Emails will be sent to specific users about certain information.

This first part will be about notifying users of existing active messages. These are  messages which are active for a certain duration in the environment, while they should be already processed within this timeframe. Beware, when you have some long running process in your BizTalk environment, these need to be excluded in the WMI call that is being constructed later in this article.

These small scripts consist a little vbscript, using wmi classes and can be hosted in a scheduled task on the BizTalk server(s) for example. I will walk through the vbscript that we set up to perform this task:

First start is defining a number of variables. A timeout of the script itself and some elements that we’ll be using in the script. Some variables are already assigned a value. The “TimeInterval” is the time in minutes that an instance in BizTalk should be active when this informational email is being sent. The email addresses are the ‘To’ and ‘Cc’ addresses to which the emails should be sent.

The following step is the initialization of the WMI classes to execute queries on the BizTalk environment. The WMI is initialized with the connectionstring to the BizTalk environment and the full CIM datetime (currect datetime) is calculated. The timeinterval (in this case 30 minutes) is deducted from the current timestamp, to get all instances which are older than 30 minutes.

Next, the query is set up and being executed. IMPORTANT! All service instances with service type id “BB3A1470-F5C4-47C3-B71F-EAABC260FBD0” are being excluded. These are CacheRefresh instances and are instances internally used in the BizTalk core.

When the results are loaded into svcInsts, the script will loop over every instance found and construct a description which will later be sent through email. Finally, when the full description is constructed, the ‘SendEmail function is called.

The function ‘SendEmail’ has the simple task to construct a full message which can be sent to the smtp server. The environment of the process executing the script (objEnv) is being loaded and an object is created to store the message (objMessage). As an extra, the mail is given priority “high”. The SMTP server is being read from the previously loaded environment (objEnv).

This way of working can also be used for other elements to monitor BizTalk. In the next post, I’ll be talking about the same type of script to process and terminate automatically dehydrated instances.

Thanks for reading, if you have any remarks or questions, please leave them in the comments section!

Author: Andrew De Bruyne



Curious to know more about this topic?

Working at i8c

i8c is a system integrator that strives for an informal atmosphere between its employees, who have an average age of approx 30 years old. We invest a lot of effort in the professional development of each individual, through a direct connection between the consultants and the management (no multiple layers of middle management). We are based in Kontich, near Antwerp, but our customers are mainly located in the triangle Ghent-Antwerp-Brussels and belong to the top 500 companies in Belgium (Securex, Electrabel, UCB, etc…).

Quality Assurance

i8c is committed to delivering quality services and providing customer satisfaction. That’s why we invested in the introduction of a Quality Management System, which resulted in our ISO9001:2000 certification. This guarantees that we will meet your expectations, as a reliable, efficient and mature partner for your SOA & integration projects.

i8c - ISO9001-2015

Also worth reading

AWS AppFlow: Streamlining SaaS Integrations with AWS Services

In today’s digital world, organizations are constantly looking for ways to streamline their workflows and improve their data management processes. One of the key challenges that organizations face is integrating their various software as a service (SaaS) applications with their data management systems. This is

Read More »

Apigee Scope Validation using OpenAPI Specification

In API security and management, we often use a lot of different security mechanisms to protect the requested resource behind the API Gateway. One of these mechanisms is the validation of scopes to authorize a client on a specific sub-resource of the API. Most of

Read More »