Windows Azure Pack SQL 的“无法访问 SQL Server 错误”监视器

WindowsAzurePack.Monitor.InaccessibleSqlServer.SqlServers (UnitMonitor)

错误,无法访问 SQL。

Knowledge Base article:

摘要

监视从 Windows Azure Pack Web 服务器到 SQL Server 的数据库连接性。通过定期检查事件日志中的中断连接事件可实现此目的。

原因

如果此监视器处于错误状态,表明无法从已在事件日志中注册事件的 Web 服务器连接 SQL Database。

解决方法

检查 Windows Azure 服务器网站使用的 SQL Server 数据库的状态。验证 Web 服务器上所使用的 Web 终结点的应用程序池帐户是否配置为能够访问数据库服务器。检查应用程序池帐户密码是否已过期。

配置

若要使此监视器正常工作,它必须能够读取事件日志。

选项

定义

默认值

警报开启状态

生成警报的监视器的运行状态。

监视器处于 “危急”运行状态

警报优先级

为此监视器生成的警报的优先级。

警报严重性

为此监视器生成的警报的严重性。

危急

自动解决警报

指定是否应在监视器返回正常状态时自动解除警报。

True

启用

指定是否应运行监视器。

True

生成警报

指定监视器是否应在其状态转变为“警告”或“危急”时生成警报。

True

时间间隔

两次运行监视器之间间隔的秒数。

300

Element properties:

TargetWindowsAzurePack.ResourceProvider.SqlServers
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeWindowsAzurePack.MonitorType.CustomSingleEventLogTimer2StateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
错误: Windows Azure Pack SQL Server 的“无法访问 SQL Server 错误”警报
错误: 无法访问 SQL。事件 214。
RunAsDefault
CommentWAP Monitor Event for SQL Resource Provider

Source Code:

<UnitMonitor ID="WindowsAzurePack.Monitor.InaccessibleSqlServer.SqlServers" Accessibility="Public" Enabled="true" Target="WindowsAzurePack.ResourceProvider.SqlServers" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="WindowsAzurePack.MonitorType.CustomSingleEventLogTimer2StateMonitorType" ConfirmDelivery="false" Comment="WAP Monitor Event for SQL Resource Provider">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="WindowsAzurePack.Monitor.InaccessibleSqlServer.AlertMessage.SqlServers">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ErrorEventRaised" MonitorTypeStateID="EventRaised" HealthState="Error"/>
<OperationalState ID="TimerEventRaised" MonitorTypeStateID="TimerEventRaised" HealthState="Success"/>
</OperationalStates>
<Configuration>
<!-- Computer name for the first event. We will use a variable to get the target computer name. -->
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<!-- Name of the log containing the first event. -->
<LogName>Microsoft-WindowsAzurePack-MgmtSvc-SQLServer/Operational</LogName>
<!-- Expression for the first event -->
<Expression>
<And>
<!-- Expression for the first event number -->
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">214</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<!-- Expression for the first event source -->
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-WindowsAzurePack-MgmtSvc-SQLServer</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<TimerWaitInSeconds>10800</TimerWaitInSeconds>
</Configuration>
</UnitMonitor>