为应用程序故障 CSM 事件生成警报

Microsoft.SystemCenter.Apm.CsmApplicationInstance.AlertAppFailureAspectRule (Rule)

Knowledge Base article:

摘要

当指定间隔中的客户端异常事件总数超出监视器阈值时,对象状态将变为不正常。

原因

客户端应用程序故障中的警报是由 Internet 浏览器中发生的未处理 JavaScript 异常导致的。 警报详细信息显示有关异常的信息,以及其堆栈跟踪和在异常发生时捕获的其他浏览器状态数据。 客户端异常是由应用程序代码中的错误导致的,要了解这些异常的原因,将需要对随警报详细信息提供的异常堆栈跟踪和数据进行分析。

解决方法

要解决客户端应用程序中未处理的 JavaScript 异常,请查看随警报提供的异常数据详细信息。 通常,解决应用程序异常将需要访问应用程序源代码。

通过使用“警报描述”中和“警报上下文”选项卡上提供的指向事件详细信息的链接,你可以访问有关此警报的其他详细信息。 该链接将在 Application Diagnostics 控制台中打开事件。 Application Diagnostics 控制台包含特定于此事件的信息,以及特定于检测到的相关事件和类似事件的信息。

Element properties:

TargetMicrosoft.SystemCenter.Apm.CsmApplicationInstance
CategoryAlert
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableFalse
Alert Message
客户端应用程序异常
已在 {2} 上的应用程序 {1} 中检测到 {0}。 有关其他详细信息,请使用以下链接: $Url[Query='{3}']/APMEvent$

Member Modules:

ID Module Type TypeId RunAs 
LOBProvider DataSource Microsoft.SystemCenter.Apm.Csm.LobDataProvider Default
AlertWriteAction WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SystemCenter.Apm.CsmApplicationInstance.AlertAppFailureAspectRule" Enabled="false" ConfirmDelivery="false" Target="Microsoft.SystemCenter.Apm.CsmApplicationInstance" Remotable="false">
<Category>Alert</Category>
<DataSources>
<DataSource ID="LOBProvider" TypeID="Microsoft.SystemCenter.Apm.Csm.LobDataProvider">
<Name>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/ApplicationName$ (Client)</Name>
<AspectType>applicationfailure</AspectType>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="AlertWriteAction" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name='Microsoft.SystemCenter.Apm.CsmApplicationInstance.AlertAppFailureAspectRule.AlertMessage']$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventData/problemDescription$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="AL!Microsoft.SystemCenter.Apm.ApplicationInstanceBase"]/ApplicationName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter3>
<AlertParameter4>$Data/EventData/ViewDetail$</AlertParameter4>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/EventData/eventConsolidationHash$</SuppressionValue>
</Suppression>
<Custom1>ApplicationFailure</Custom1>
</WriteAction>
</WriteActions>
</Rule>