来自BizTalk的电子邮件通知,用于失败的消息&来自事件查看器的错误 [英] Email notification from BizTalk for failed messages & error from event viewer

查看:112
本文介绍了来自BizTalk的电子邮件通知,用于失败的消息&来自事件查看器的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此处输入图片描述请让我知道如何在每次收到电子邮件通知时消息在BizTalk中以及事件查看器中出现错误时都失败.

enter image description herePlease let me know how to get email notification whenever an message fails in BizTalk and also whenever there is error in event viewer.

推荐答案

我认为这取决于您的解决方案.在我开发的解决方案中,我已经确定了由于错误转换,缺少字段等而导致的消息路由的大多数故障点.然后将它们路由到业务流程,该业务流程专门仅发送SMTP电子邮件以设置地址.这对我公司的要求来说效果很好. -您可以通过快速的Google找到很多SMTP编排示例..我开始

I think this depends on your solution. Within the solution I have developed, I have identified most points of failure on message routing, due to mistransformations, missing fields etc. These are then routed to an Orchestration which specifically only sends SMTP emails to set addresses. This works fairly well for the requirements of my company. - you can find plenty of SMTP Orchestration examples with a quick google.. I started here

与此同时进行-对于未知情况,我还设置了一个powershell脚本通过电子邮件发送Windows Log Event Viewer的最后一条消息.我已经使用BizTalk管理控制台创建了一个自定义查看器.

In tandem with this - for the unknowns, I have also set up a powershell script to email out the last message of the Windows Log Event Viewer. I have created a custom viewer using the BizTalk Administrative console..

<QueryList>
  <Query Id="0" Path="Application">
    <Select Path="Application">*[System[Provider[@Name='BizTalk DW Reporting' or @Name='BizTalk Server' or @Name='BizTalk Server Deployment' or @Name='BizTalk Server EDI' or @Name='ENTSSO' or @Name='XLANG/s'] and (Level=1  or Level=2)]]</Select>
  </Query>
</QueryList>

,然后将其导出到Windows任务计划中,每当它检测到有新条目落在自定义查看器中时,就会触发一个powershell脚本.

and then exported that out into a Windows Task Schedule, that triggers a powershell script whenever it detects that there is a new entry that lands in the custom viewer.

我遵循提供的粗略原则此处以获取Powershell脚本.

I have followed the rough principles provided here for the powershell script.

希望这会为您指出所需的正确方向.可能有更好的解决方案,但是效果很好.

Hope this points you in the right direction for what you need. There are probably better solutions, but this works fairly well.

这是我正在使用的powershell脚本

This is the powershell script I am using

$event = get-eventlog -LogName Application -Source "XLANG/s","BizTalk Server","BizTalk DW Reporting","BizTalk Server Deployment","BizTalk Server EDI","ENTSSO" -EntryType "Error" -newest 1
#get-help get-eventlog will show there are a handful of other options available for selecting the log entry you want.
$eventtime = $event.TimeGenerated


#ignore any messagebox errors
if (($event.EntryType -eq "Error"  -and $event.EventID -inotin 6998, 10514))
{
    $Source = $event.Source
    $PCName = $env:COMPUTERNAME
    $EmailBody = "$Source Error captured at " + $event.TimeGenerated + " in windows error log on BizTalk-UAT server: `n`n" + $event.Message
    $EmailFrom = "????-BizTalk-UAT@???.com"
    $EmailTo = @('????-BizTalk-UAT@???.com') 
    $EmailSubject = "BizTalk-UAT Server - Windows Log - " + $event.EntryType
    $SMTPServer = "mail.????.com"
    Write-host "Sending Email" $EmailFrom "To" $EmailTo
    Send-MailMessage -From $EmailFrom -To $EmailTo -Subject $EmailSubject -body $EmailBody -SmtpServer $SMTPServer

}
else
{
    write-host "No error found"
    write-host "Here is the log entry that was inspected:"
$event
}

这篇关于来自BizTalk的电子邮件通知,用于失败的消息&amp;来自事件查看器的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆