需要重新啟動 IIS

Microsoft.SystemCenter.Apm.Infrastructure.Monitoring.ApmAgent.IISRestart.Monitor (UnitMonitor)

此監視會追蹤因為在 Web 伺服器上執行之應用程式的監視設定變更而需要重新啟動的 IIS。

Knowledge Base article:

摘要

此監視會追蹤因為在 Web 伺服器上執行之應用程式的監視設定變更而需要重新啟動的 IIS。當 IIS 需要回收時,此監視會轉變為狀況不良狀態。

原因

使用 .NET 應用程式效能監視範本修改應用程式監視設定時,可能需要重新啟動 IIS,以使新的設定生效。需要重新啟動 IIS 的案例之一是當您在 Web 伺服器上設定第一個應用程式的 .NET 應用程式監視時。

解決方式

Element properties:

TargetMicrosoft.SystemCenter.Apm.ApmAgent
Parent MonitorSystem.Health.ConfigurationState
CategoryCustom
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.Apm.Infrastructure.Monitoring.IISRestart.MonitorType
RemotableFalse
AccessibilityPublic
Alert Message
需要重新啟動 IIS
伺服器 {0} 上的應用程式監視設定已修改。為了套用新設定,您必須重新啟動該伺服器上的 IIS。待 IIS 重新啟動後,才會套用新的監視設定。不過,受監視的應用程式仍可正常運作。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.Apm.Infrastructure.Monitoring.ApmAgent.IISRestart.Monitor" Accessibility="Public" Enabled="true" Target="AI!Microsoft.SystemCenter.Apm.ApmAgent" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="false" Priority="Normal" TypeID="Microsoft.SystemCenter.Apm.Infrastructure.Monitoring.IISRestart.MonitorType" ConfirmDelivery="false">
<Category>Custom</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.Apm.Infrastructure.Monitoring.ApmAgent.IISRestart.Monitor.AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="ApplicationStateOK" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="ApplicationStateWarning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
</Configuration>
</UnitMonitor>