OpsMgr 2007 - SQL Query for Alert Information
One of the users on SystemCenterCommunity requested a SQL query for scom to get the following information: Managed computer, Alert description and Alert severity. I wrote the following SQL query to do that only instead of getting the Managed Computer name I use the MonitoringObjectDisplayName. I should be able to figure out how to get this same information from a powershell one liner too.
-- Scott Moss
-- 10/27/2008
-- SCOM 2007 SP1 OPerationsManager DB Query
-- Get listing of MonitoringObject, Alert descriptiong and Severity
-- http://myitforum.com/cs2/blogs/smoss
select
MonitoringObjectDisplayName,
AlertStringName,
AlertStringDescription,
'Severity' = Case
When AlertView.Severity = 0 Then 'INFORMATIONAL'
When AlertView.Severity = 1 Then 'WARNING'
When AlertView.Severity = 2 Then 'CRITICAL'
Else 'Undetermined'
End
From AlertView