This blog is intended to demonstrate how to create a dashboard for System Center 2012 R2 Configuration Manager using SQL 2012 Reporting Services and Report Builder 3.0.
For a practical demonstration, a dashboard for software updates will be created that uses tables, a pie chart, a line chart, and a column chart.
The built in reports for software updates contain a large quantity of information however, there isn’t a dashboard to provide a quick overview of update status. In its given state, you would have to drill down into multiple reports, export the data, and then manipulate it in a spreadsheet to present it in a dashboard form. It is possible to run SQL queries from within Excel or PowerPoint to display a dashboard but that’s beyond the scope of this blog.
Since there are so many different angles to display software update statuses, this dashboard will contain a query that will display data based on the v_Update_ComplianceStatusReported view. This view contains the status of each software update for each system that has successfully performed a scan. It is important to note this as if you want a query based off a list of updates (software update groups) or a success rate to include inactive systems then this dashboard won’t work for you although you could use the examples and create your own dashboard.
The v_Update_ComplianceStatusReported view contains a column called “Status” to indicate if an update is Installed, Required, or Not Applicable. Since we are only concerned about installed or required updates, the not applicable status will be filtered out and significantly reduce the number of data queried on.
The dashboard will allow filtering by collection and a duration (a start date and an end date) to display the following:
- A table with the collection name, number of devices, number of devices that performed a software update scan in the last 30 days, number of systems that performed a hardware inventory in the last 30 days
- A table that displays each required or installed update with the number of applicable systems, the article ID, the Bulletin ID, the Title, whether it is superseded, the Date the update was posted, whether it is deployed or not, the category, and the severity of the update.
- A Pie chart that displays each inventoried operating system
- A Line chart that displays the number of required and installed updates by month (or every couple months to fit in the graph)
- A table with the total number of updates, the count or required updates, the count of installed updates, the count of deployed updates, and the count of updates not deployed
- A Column chart that displays the number of updates installed or required by severity
- A Column chart that displays the number of updates installed or required by category
This screenshot is what the dashboard will look like
Getting Started
Ensure you can browse to both the Reports (e.g. http:///Reports) and ReportServer (e.g. http:///ReportServer) web pages on your server hosting SQL Reporting services.
Launch Report Builder 3.0 elevated (“Run as Administrator”) using and an account that has admin credentials to both the SQL server and ConfigMgr. Although the account doesn’t need to be an administrator, for simplicity sake an admin account will be used in this demonstration.
Close the Getting Started screen. On the left hand pane there are 5 folders to get familiar with. If you don’t see the pane click the view tab then check Report Data.
- The Built-in Fields won’t be used
- The Parameters are variables that will be passed to the Datasets
- The images will contain the system center logo
- The Data Sources is the connection to the ConfigMgr database
- The Datasets are the SQL queries
For more information view the Report Data Pane on Technet.
- Let’s start with the layout first. Select the View tab then check Properties. Click the center of the report then change the size in the Properties pane to 12.7in, 9.48in or your own custom size.
- Click the line in for the title text box. In the Properties pane change the Location to 1in, 0in and the Size to 4.15in, 1in. Click the Home tab then change the font to Calibri 20 Bold. Click inside the Textbox and enter Software Updates Dashboard.
- Click the Insert tab then click Text Box. Draw a textbox next to the Software Updates Dashboard textbox to the edge of the report. Click the border of the textbox and change the size to 7.37833in, 1in and the location to 5.32167in, 0in. You may need to adjust the width to ensure it isn’t off the report. When resizing the textbox it should snap to the edge.
- Within the Insert tab click Image. Draw the image in the upper left hand corner. When the Image Properties box appears, click the Import button then select an image.
- The top of your report should look like this:
- Scroll to the bottom of the report and delete the textbox with the Execution Time.
You should now have a basic layout for your dashboard and can change it to meet your needs.
To view what the report will look like press F5 or click the Run button in the Home tab.
In Part 1 it was mentioned that the dashboard will accept
certain parameters. By default, SRS will list 2 parameters per line.
certain parameters. By default, SRS will list 2 parameters per line.
For the Collection parameter, the dashboard will display the collections name but will pass its Unique ID to the datasets in a variable called ColID.
To create this parameter, a dataset needs to be created. To create the dataset, a data source is required.
Creating the Data Source
- In the Report Data pane right click Data Sources--> Click Add Data Source
- The Data Source Properties window will appear
- Change the Name to CM
- Select Use a connection embedded in my report
- Select Microsoft SQL Server as the connection type
- Click the Build… button
- Enter the Server name to the SQL server
- Select the ConfigMgr database
- Click Test Connection to ensure that a connection could be established
- Click OK
- Click OK
Creating the All_Collections Data Set
- In the Report Data pane right click Datasets --> Click Add Dataset
- The Dataset Properties window will appear
- Change the Name to All_Collections
- Select Use a dataset embedded in my report
- Select the CM Data source
- In the Query box enter the following: select distinct c.CollectionID, c.Name from v_Collection c order by c.Name
- Click OK
Creating the ColID Parameter
- In the Report Data pane right click the Parameters folder --> Click Add Parameter.
- The Report Parameter Properties window will appear
- Change the Name to ColID (this is spelled colid)
- Change the prompt to Select a collection
- Click Available Values
- Select Get values from a query from the dataset
- Select CollectionID for the Value field
- Select Name for the Label field
- Click Default Values
- Select Specify values
- Click the Add button
- Enter SMS00001 for the Value
- This is the Collection ID for the All Systems collection.
- Click OK
Your Report data pane should look like this:
Creating the other parameters
Month Parameters
Although it is possible to create datasets for the other parameters, this demonstration will use static entries.
- In the Report Data pane right click the
Parameters folder --> Click Add Parameter.
- The Report Parameter Properties window will appear
- Change the Name to StartMonth
- Change the prompt to Select a month that the report will start from
- Change the Data type to Integer
- Click Available Values
- Select Specify values
- Click the Add button 12 times
- Enter January for the Label and 1 for the Value
- Repeat this until you have December for the Label and 12 for the Value
- Click Default Values
- Select Specify values
- Click the Add button
- Click the fx button
- The Expression window will appear
- Enter =Month(today()) for the expression value
- This will get the number value of the month for day the report is run
- Click OK
- Click OK
Repeat these steps for the EndMonth parameter with the prompt of Select a month the report will end with
Year Parameters
Similar to the Month parameter the dashboard will create static year parameters with the starting year having a slight twist to its default value.
- In the Report Data pane right click the Parameters folder --> Click Add Parameter.
- The Report Parameter Properties window will appear
- Change the Name to StartYear
- Change the prompt to Select a year that the report will start from
- Change the Data type to Integer
- Click Available Values
- Select Specify values
- Click the Add button 10 times
- Enter 2004 for both the Label and Value
- Repeat this until you have 2014for both the Label and Value
- You may add or remove in more entries if you want to report update older or newer than 2004
- Click Default Values
- Select Specify values
- Click the Add button
- Click the fx button
- The Expression window will appear
- Enter =Year(today()) -1 to default the report to the year previous to when it is run
- Click OK
- Click OK
Repeat these steps for the EndYear parameter with the prompt of Select a year that the report will end withand a default value of =Year(today())
Your Report Data pane should now look like this:
Creating Other Datasets
- Similar to how the All_Collections dataset was created, create the All_OperatingSystems Dataset with the query of:
select distinct c.Name [Collection Name], gsos.Caption0 [Operating System], count(gsos.Caption0)[Number of Systems]from v_R_System rs
JOIN v_FullCollectionMembership fcm on rs.ResourceID = fcm.ResourceIDJOIN v_Collection c on c.CollectionID = fcm.CollectionIDJOIN v_GS_OPERATING_SYSTEM gsos on gsos.ResourceID = fcm.ResourceIDWHERE c.CollectionID = @ColID
group by c.Name, fcm.collectionID, gsos.Caption0 - Create another Dataset called Collection_Details with the query of:select distinct c.Name, count(rs.ResourceID) [Devices], (Select Count(LastScanTime) fromv_UpdateScanStatus uss where datediff("d",LastScanTime, getdate()) <= 30) [Scanned last 30 Days],(Select Count(LastHWScan) from v_GS_WORKSTATION_STATUS gsws where datediff("d",LastHWScan,getdate()) <= 30) [Inventory last 30 Days]from v_FullCollectionMembership fcm
JOIN v_Collection c on c.CollectionID = fcm.CollectionIDJOIN v_R_System rs on rs.ResourceID = fcm.ResourceIDLEFT JOIN v_GS_WORKSTATION_STATUS gsws on gsws.ResourceID = fcm.ResourceIDwhere fcm.CollectionID = @ColIDgroup by c.Name - Create the final dataset called Software_Update_Details with the query of:DECLARE @StartDate datetime, @EndDate datetimeSet @StartDate = DATEFROMPARTS(@StartYear,@StartMonth,1)Set @EndDate = DATEFROMPARTS(@EndYear,@EndMonth,1)
Select ucs.CI_ID, count(ucs.CI_ID) [Count],CASE((status))
When 3 Then 'Installed' When 2 Then 'Required' Else 'Not Applicable' End as 'Status', BulletinID,ArticleID,
CASE((IsDeployed))
When 0 Then 'No' Else 'Yes' End as 'Deployed',
CASE((ui.IsSuperseded))When 0 Then 'No' Else 'Yes' End as 'Superseded',
CASE((ui.IsExpired))
When 0 Then 'No' Else 'Yes' End as 'Expired',ui.Title, ui.DatePosted, cica.CategoryInstanceName,
CASE((ui.Severity))
When 2 Then 'Low'When 6 Then 'Moderate'When 8 Then 'Important'
When 10 Then 'Critical'Else 'NA' End as 'Severity'
From v_Update_ComplianceStatusReported ucsJOIN v_UpdateInfo ui on ucs.CI_ID = ui.CI_IDJOIN v_CICategoryInfo_All cica JOIN v_CategoryInfo ci on cica.CategoryInstanceID =ci.CategoryInstanceID AND cica.CategoryTypeName = 'UpdateClassification' on ucs.CI_ID = cica.CI_IDWhere resourceid IN(Select ResourceID from v_FullCollectionMembership where CollectionID = @ColID)AND ui.DatePosted BETWEEN @StartDate AND @EndDate AND ucs.status <> 1
GROUP BY ucs.CI_ID, ucs.status, BulletinID, ArticleID, IsDeployed, ui.Title, DatePosted,cica.CategoryInstanceName, cica.CategoryInstanceID,ui.IsSuperseded, ui.Severity, ui.IsExpiredORDER BY ucs.status, BulletinID, ArticleID
Your Report Data pane should now look like this:
Creating a Custom Report for System Center 2012 R2 Configuration Manager – Part 4
10 Dec 2013 6:32 PM
No comments:
Post a Comment