Event Reporting with Power View
I spend most of my time with events troubleshooting specific problems instead of looking for trends. However, event logs contain a wealth of information about what’s happening in an environment. Events can result in alerts, too. I will get into alert analysis in the next post, but alerts and events have very similar behavior. I use the same visualization techniques for both.
In another post, “Performance Reporting with Power View” (<www.scom2k7.com/performance-reporting-with-power-view/>), I used Excel to create report views. This time I switch to SharePoint 2013 for creating views with event data from the SCOM Data Warehouse. The same Power View functions apply, but SharePoint has distinct advantages (rdlx files, Reading Mode, view duplication, export to PowerPoint) which serve larger scale reporting.
Here’s a chronological view of events tiled by management pack:
I’ll take advantage of features added with SQL Server 2012 SP1 (pie charts, drill downs) to simplify analysis. I will make use of the themes to make error counts display in red, too.
By the way, the SCOM DW contains event information (Event Number, Publisher, User Name, Logging Computer, Parameters, Rendered Description) which I haven’t included. I designed this model for creating high level views to finds trends and tuning opportunities. I will write about modeling specific technologies and simplifying complex variables in other posts.
Overview
A. Add datasets to an Excel 2013 PowerPivot data model
B. Create relationships
C. Manipulate the data
D. Upload the Excel workbook to SharePoint 2013 with BI features
E. Make a Power View report
F. 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 Events
Copy and Paste in the following query:
--Events
SELECT
EV.DateTime
,EV.EventChannelRowId
,EV.EventLevelId
,ER.RuleRowId
,ER.ManagedEntityRowId
FROM Event.vEvent EV
INNER JOIN Event.vEventRule ER on ER.EventOriginId = EV.EventOriginId
WHERE EV.DateTime > (GETUTCDATE() - 65)
--WHERE EV.DateTime > (GETUTCDATE() + 1) -- Dummy condition to return no rows
Note: It is a good idea to test the date range in the query to find what works best in your environment.
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 Event Entities
Copy and Paste in the following query:
--Event Entities
select distinct
ME.ManagedEntityRowId
,ME.ManagementGroupRowId
,ME.Name
,ME.DisplayName
,ME.Path
,ME.ManagedEntityTypeRowId
FROM Event.vEvent EV
inner join Event.vEventRule ER on ER.EventOriginId = EV.EventOriginId
inner join vManagedEntity ME on ME.ManagedEntityRowId = ER.ManagedEntityRowId
inner join vManagedEntityManagementGroup MEMG on MEMG.ManagedEntityRowId = ME.ManagedEntityRowId
inner join vManagedEntityType MET on MET.ManagedEntityTypeRowId = ME.ManagedEntityTypeRowIdClick Finish
Click Close
Repeat steps 15-22 to create datasets Channel, Level, and Rules and MPs using these queries:
--Channel
SELECT *
FROM vEventChannel--Level
SELECT *
FROM vEventLevel--Rules and MPs
select distinct
ER.RuleRowId
,RU.RuleDefaultName
,MP.ManagementPackDefaultName
,MP.ManagementPackSystemName
from Event.vEventRule ER
inner join vRule RU on RU.RuleRowId = ER.RuleRowId
inner join vManagementPack MP on MP.ManagementPackRowId = RU.ManagementPackRowId
B. Create relationships
Click Diagram View in the Ribbon
Click EventChannelRowId in the Events dataset and drag a line to EventChannelRowId in the Channel dataset
Click EventLevelId in the Events dataset and drag a line to EventLevelId in the Level dataset
Click ManagedEntityRowId in the Events dataset and drag a line to ManagedEntityRowID in the Event Entities dataset
Click RuleRowId in the Events dataset and drag a line to RuleRowId in the Rules and MPs dataset
C. Manipulate the data
- Click Data View in the ribbon
- Select the Events dataset
- Click an empty field under Add Column
- Enter a DAX statement in the function field for the date
=DATEVALUE([DateTime])
- Press Enter
- Right click CalculatedColumn1 and select Rename Column
- Type Date and press Enter
- Click an empty field under Add Column
- Enter a DAX statement in the function field for the date and hour
=TIME(hour([DateTime]),0,0)+[Date] - Right click CalculatedColumn1 and select Rename Column
- Type Date+Hour and press Enter
- 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 events
Event_Count:=COUNTROWS(Events) - Close the PowerPivot window
- Save the workbook
- Close the workbook
D. Upload the Excel workbook to SharePoint 2013 with BI features
- Navigate to a SharePoint 2013 PowerPivot Gallery
- Select Files then click Upload Document
- Click Browse…
- Navigate to the Excel workbook location and select the workbook
- Click Open
- Click OK
E. Make a Power View report
Click the Create Power View Report icon next to the uploaded workbook
Enter Event Summary in the Click here to add a title textbox
Expand the Level dataset in the Field List then click the checkbox next to EventLevelTitle
Click in the open area of the report to deselect any objects
Expand the Channel dataset then click the checkbox next to EventChannelTitle
Click the Slicer icon
Click in the open area of the report to deselect any objects
Expand the Events dataset
Click the checkboxes next to Date, Date+Hour, and Event_Count
Drag the Date+Hour field from LEGEND to AXIS underneath Date
Expand the Rules and MPs dataset
Click in the open area of the report to deselect any objects
Click the checkboxes next to ManagementPackDefaultName and RuleDefaultName from the Rules and MPs dataset
Click the checkbox next to Event_Count from the Events dataset
Expand the Event Entities dataset
Click the checkbox next to Path
Select the Show Levels pulldown then select Enable drill down on rows
Click the Comma Style icon in the Number section of the ribbon
Press Ctrl-C to copy the matrix
Press Ctrl-V to paste the matrix
Select the Design tab
Change the sort order for the pie chart by clicking on the sort by values
Select the Layout tab
Select the Styles tab
Select the Background pulldown and click the background on the bottom right
Arrange and resize the report objects so they don’t overlap
Here is how my example report looks:
F. Interact with the report
- View the volume of errors and warnings in the system log
- Show events by hour for the day with the highest event count
- Change the chart legend
- Drill down to rules then to servers
- Select an MP in the matrix then click Drill down
- Double click on the corresponding pie slice
- Select a rule in the matrix then click Drill down
- Double click on the corresponding pie slice (or entire pie in this case)
- Click a pie slice (Ctrl-click to select additional slices) to view events for that server
- Select an MP in the matrix then click Drill down
-
- Go back to the top level of each object by clicking Drill up twice
Comments
- Anonymous
April 01, 2014
Fantastic post.Thanks??