select --top 25 --Uncomment if your dashboard is working too long and get instances by parts
PathT.FullName
,ClassT.Name as ClassName
,UnhealthyState.MonitorName
from
dbo.StateView as UnhealthyState WITH (NOLOCK)
left join dbo.AlertView as OpenAlerts
on
UnhealthyState.BaseManagedEntityId = OpenAlerts.MonitoringObjectId and
OpenAlerts.ResolutionState <> 255 and OpenAlerts.IsMonitorAlert = 1 and LanguageCode = 'ENU'
inner join dbo.ManagedEntityGenericView PathT
on
PathT.id = UnhealthyState.BaseManagedEntityId and PathT.MonitoringClassId= UnhealthyState.TargetManagedEntityType
inner join [dbo].[ManagedTypeView] As ClassT
on
ClassT.id = UnhealthyState.TargetManagedEntityType and ClassT.LanguageCode = 'ENU'
where
UnhealthyState.HealthState in (3,2) --only ERROR и WARN
and UnhealthyState.OperationalState is not NULL --not aggregate or dependency monitor
and UnhealthyState.MonitorName not in
('Insert MonitorName' -- you can remove some motinor from query
,'Insert MonitorName'
)
--and UnhealthyState.MonitorName not like '%SQL%' -- you can use like or not like to show specific monitors
--and UnhealthyState.MonitorName not like '%network%'
--and OpenAlerts.Id is NULL -- Alert was closed or did not exist