Alert Reporting with Power View
SCOM monitors and rules can both generate alerts. Outside of SCOM administrators and operators, most people won’t care which method resulted in an alert. This creates a bit of a challenge, because in previous posts I focused on data collection rules for performance and events. For alerts, instead of dealing with monitors and rules separately, I will collapse them into workflows. This presents its own problem, since it appears workflow IDs may be recycled between monitors and rules. I will use DAX and the Monitor Alert Indicator value to work around this.
Alerts typically carry an expectation that something needs to be fixed. For this reason, it is useful to customize views for an audience. I will spend some time using filters to remove distracting data from a view.
This filtered view shows System Center related alerts:
In the interest of clarity I will repeat the data modeling procedure from my earlier posts. However, I will manipulate the data before creating relationships, because I am going to create a relationship between calculated columns. For the Power View section I will use SharePoint 2013.
Overview
A. Add datasets to an Excel 2013 PowerPivot data model
B. Manipulate the data
C. Create relationships
D. Make a Power View report
E. Interact with the report
Step by step
A. Add datasets to an Excel 2013 PowerPivot data model
Open Excel 2013
Click the POWERPIVOT tab
-
Select From Database then select From SQL Server from the pulldown
Enter a name like SCOM_DW in the Friendly connection name: field
Enter the SCOM Data Warehouse server name (with instance and port, if necessary) in the Server name: field
Select the name of the SCOM DW (OperationsManagerDW by default) from the Database name: pulldown
Click Next
On the How to Import the Data dialog select Write a query that will specify the data to import
Click Next
In the Friendly Query Name field type Alerts
Copy and Paste in the following query:
--Alerts
SELECT AL.AlertName
,AL.AlertDescription
,AL.Severity
,AL.Priority
,AL.Category
,AL.ManagedEntityRowId
,AL.MonitorAlertInd
,AL.RaisedDateTime
,AL.RepeatCount
,AL.DWCreatedDateTime
,AL.WorkflowRowId
FROM Alert.vAlert AL
--WHERE AL.RaisedDateTime > (GETUTCDATE() + 1) -- Dummy condition to return no rows
WHERE AL.RaisedDateTime > (GETUTCDATE() - 35)Click Finish
Click Close
Click Existing Connections in the Ribbon
Select SCOM_DW from the PowerPivot Data Connections
Click Open
Select Write a query that will specify the data to import and click Next >
In the Friendly Query Name type Alert Entities
Copy and Paste in the following query:
--Alert Entities
select distinct
ME.ManagedEntityRowId
,ME.Name
,ME.DisplayName
,ME.Path
,ME.ManagedEntityTypeRowId
from Alert.vAlert AL
inner join vManagedEntity ME on ME.ManagedEntityRowId = AL.ManagedEntityRowId
inner join vManagedEntityManagementGroup MEMG on MEMG.ManagedEntityRowId = ME.ManagedEntityRowId
inner join vManagedEntityType MET on MET.ManagedEntityTypeRowId = ME.ManagedEntityTypeRowId
order by ME.ManagedEntityTypeRowIdClick Finish
Click Close
Repeat steps 15-22 to create datasets Workflows and MPs using these queries:
--Workflows
(SELECT RU.RuleDefaultName as WorkflowName
,RU.ManagementPackRowId
,AL.MonitorAlertInd
,AL.WorkflowRowId
FROM Alert.vAlert AL
inner join vRule RU on RU.RuleRowId = AL.WorkflowRowId
where AL.MonitorAlertInd = '0'
and AL.RaisedDateTime > (GETUTCDATE() - 35))
union
(SELECT MON.MonitorDefaultName as WorkflowName
,MON.ManagementPackRowId
,AL.MonitorAlertInd
,AL.WorkflowRowId
FROM Alert.vAlert AL
inner join vMonitor MON on MON.MonitorRowId = AL.WorkflowRowId
where AL.MonitorAlertInd = '1'
and AL.RaisedDateTime > (GETUTCDATE() - 35))--MPs
SELECT MP.ManagementPackRowId
,MP.ManagementPackDefaultName
,MP.ManagementPackSystemName
FROM vManagementPack MP
WHERE MP.ManagementPackRowId in (
SELECT distinct RU.ManagementPackRowId
FROM Alert.vAlert AL
inner join vRule RU on RU.RuleRowId = AL.WorkflowRowId
WHERE AL.MonitorAlertInd = '0'
and AL.RaisedDateTime > (GETUTCDATE() - 35)
)
OR MP.ManagementPackRowId in (
SELECT distinct MON.ManagementPackRowId
FROM Alert.vAlert AL
inner join vMonitor MON on MON.MonitorRowId = AL.WorkflowRowId
WHERE AL.MonitorAlertInd = '1'
and AL.RaisedDateTime > (GETUTCDATE() - 35)
)
B. Manipulate the data
-
-
Click an empty field under Add Column
Enter a DAX statement in the function field for the date
=DATEVALUE([RaisedDateTime])Press Enter
Right click CalculatedColumn1 and select Rename Column
Type RaisedDate and press Enter
Repeat steps 3-7 for the following DAX statements and column names
DAX
Column Name
=TIME(hour([RaisedDateTime]),0,0)+[RaisedDate]
RaisedDate+Hour
=SWITCH([Severity],2,"Critical",1,"Warning",0,"Information")
Sev_Name
=SWITCH([Priority],2,"High",1,"Medium",0,"Low")
Pri_Name
=[WorkflowRowId]*10+[MonitorAlertInd]
WFID+MAI
Click an empty field in the section below the data columns
Enter a DAX statement in the function field to create a metric to count the number of alerts
Alert_Count:=COUNTROWS(Alerts)-
Click an empty field under Add Column
Enter a DAX statement in the function field to combine WorkflowRowId with MonitorAlertInd
=[WorkflowRowId]*10+[MonitorAlertInd]Press Enter
Right click CalculatedColumn1 and select Rename Column
Type WFID+MAI and press Enter
Close the PowerPivot window
Save the workbook
Close the workbook
-
C. Create relationships
Click Diagram View in the Ribbon
Click WFID+MAI in the Alerts dataset and drag a line to WFID+MAI in the Workflows dataset
Click ManagementPackRowId in the Workflows dataset and drag a line to ManagementPackRowID in the MPs dataset
Click ManagedEntityRowId in the Alerts dataset and drag a line to ManagedEntityRowID in the Alert Entities dataset
D. Make a Power View report
Click the Create Power View Report icon next to the workbook
Enter Alerts in the Click here to add a title textbox
Expand the Alerts dataset in the Field List then click the checkbox next to Sev_Name
Click the Slicer icon in the ribbon
Click in the open area of the report to deselect any objects
Click the checkbox next to Pri_Name in the Field List
Click the Slicer icon
Select the Sev_Name slicer
Click Increase Font Size twice
Select the Pri_Name slicer
Click Increase Font Size twice
Click in the open area of the report to deselect any objects
Click the checkboxes next to Alert_Count and Category
-
-
Change the sort order for the pie chart by clicking on the sort by values
-
Select the Layout tab
Click in the open area of the report to deselect any objects
Expand the Alert Entities and MPs datasets in the Field List
Select Alert_Count from the Alerts dataset and ManagementPackDefaultName from the MPs dataset
-
Select AlertName and AlertDescription from the Alerts dataset and DisplayName and Path from the Alert Entities dataset
Move AlertDescription to the bottom of the ROWS field
Drag Sev_Name from the Alerts dataset into the COLUMNS field
Select the Show Levels pulldown then select Enable drill down on rows
-
Click on a value in the Total column
Click the Comma Style icon in the Number section of the ribbon
Click the Decrease Decimal icon twice
-
Enter Alert Summary in the new text box and position it over the matrix
Click in the open area of the report to deselect any objects
Select Alert_Count and RepeatCount from the Alerts dataset
Click the Matrix icon
Select AlertName from the Alerts dataset and DisplayName and Path from the Alert Entities dataset
Select the Show Levels pulldown then select Enable drill down on rows
Select the Home tab
Click on a value in the RepeatCount column
Click the Comma Style icon in the Number section of the ribbon
Click the Decrease Decimal icon twice
Repeat steps 39-41 for the Alert_Count column
Click the Text Box icon
Enter High Repeat Count Alerts in the new text box and position it over the matrix
Click the Show Filters icon in the upper right part of the matrix object
Expand RepeatCount in the Filters section
-
-
Select is greater than or equal to in the top condition pulldown
Enter 10 in the value field
Click apply filter
Click in the open area of the report to deselect any objects
Drag RaisedDate from the Alerts dataset into the Filters section
-
Drag ManagementPackDefaultName from the MPs dataset into the Filters section
Select the Styles tab
Select Accent 8 from the Themes section
Select the Background pulldown and click the background on the bottom right
Arrange and resize the report objects so they don’t overlap
Select File –> Save
Enter a name without spaces in the File name: field then click Save
Here is my example report:
E. Interact with the report
- Identify alerts and their sources with Critical severity and High priority
Click Critical in the Sev_Name slicer
Click High in the Pri_Name slicer
Drill down on the management pack in the alert summary to find the alert name
Drill down on the alert name to identify the display name of the alert entity
Drill down on the alert entity to find the path
Go back to the Management Pack by clicking Drill up three times
Undo the selections by clicking Clear Filter for the slicers
- Review alerts by Category
- Click on a slice of the category pie chart or one of the legend items
- Click in the open area of the pie chart object to clear the selection
- Investigate alerts with high repeat counts
Click the RepeatCount column header to sort by value
Drill down on the alert name with the highest repeat count
Drill down on the display name to find the path
Go back to the alert name by clicking Drill up twice
- Change the filter settings for the report
- Expand the ManagementPackDefaultName filter
- Select one or more management packs from the List Filter
- Clear the list by clicking the Clear filter icon
- Expand the RaisedDate filter
- Click the Advanced Filter Mode icon
- Change the date ranges with the conditions
- Click apply filter
- Clear the conditions by clicking the Clear filter icon
Comments
Anonymous
January 01, 2003
ExcellentAnonymous
January 01, 2003
Looks Great!