Showing posts with label Report. Show all posts
Showing posts with label Report. Show all posts

Wednesday, 11 May 2011

SCOM Distributed App Health Dashboard

Since I've been doing a bit of work recently on System Center Dashboards I thought I'd quickly post this snippet that I've just done.

SELECT  distinct   BaseManagedEntity.DisplayName, case State.HealthState when 1 then 'Healthy' when 2 then 'Warning' when 3 then 'Critical' when 4 then 'Not Monitored' else 'Unknown' end as Status
FROM State INNER JOIN
BaseManagedEntity ON State.BaseManagedEntityId = BaseManagedEntity.BaseManagedEntityId
where (BaseManagedEntity.FullName like 'Service_%'
or BaseManagedEntity.DisplayName = 'Active Directory Topology Root'
or BaseManagedEntity.DisplayName = 'Certificate Services'
or BaseManagedEntity.DisplayName = 'ConfigMgr 2007 Site Hierarchy'
or BaseManagedEntity.DisplayName = 'Operations Manager Management Group')
and BaseManagedEntity.Name is NULL
or (BaseManagedEntity.DisplayName = 'Exchange Service' and State.HealthState <> '0')

This gives a result that looks like this:

If you take out the case statement so it returns 1,2 & 3's instead of Healthy, Warning & Critical then this SQL snippet can be used to create a RAG scorecard in the System Center Dashboard that produces a result like this:


Also (for my reference) Kevin Holman has a ton of useful SCOM SQL queries:
http://blogs.technet.com/b/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx

Reporting runbook sucess/failure in Opalis using Service Manager 2010

I attended the Best of MMS 2011 UK event the other week along with Rob and after the sessions got chatting to Sean Christensen about Opalis, Orchestrator (SCO) and reporting.

While SCO will be offering data feeds from the web service, from what I can tell (it's early days yet) there's no plans for a specific customised reporting module.

Chatting to Sean about this, his fresh pair of eyes suggested maybe taking the data out to another system for reporting, which led onto talking about extending Service Manager to hold the information and using the SCSM dashboards to display this back in "Management" format.

I'll not go into depth here on how we did this, I'll leave that for Rob to post about as he did the design work while I sat back and watched ;)

But briefly:
  1. We created a new MP in SCSM to hold a new class with a couple of properties.
  2. Created a new runbook in Opalis and used the SCSM IP to query & write to the new class, this can then be triggered by a policy to record it's success or failure
  3. Created a SQL query to read the new class from the DW and added it along with a graph as a sharepoint webpart
  4. Added a new dashboard view to the SCSM Dashboard MP to display the dashboard
Like I mentioned, Rob should post a more detailed post about how it's all hung together, but this is the end result:

(This is from our test environment, hence not much data)

Monday, 14 March 2011

Service Manager Custom Task to Launch SQL Report

A while ago I posed a question on the Service Manager forums about having a console task that would launch a SQL Report and pass it a parameter.
The reason behind this is that I wanted to make it as easy as possible for our analysts to be able to print a “Receipt” without having to remember asset numbers or navigate through the console to the reports node.
Travis Wright came back with a couple of answers:
1) Console task which passes the parameter value on the query string to the SRS web UI.
2) Console task which passes the parameter value to the report viewer form in SCSM console.

I’d briefly looked at suggestion 1, but taken it no further, but while suggestion 2 is my preferred method I needed to move this along quicker so I took another look at suggestion 1.
As Travis said, creating a console task to spawn Internet Explorer to the SSRS url is very easy.
First go to the Library node of the console and click Tasks

Then click Create Task

Fill in the task name and description
 Then click the “…” button next to Target Class and select the class you want this task to appear on.
 In this example I’m going to use the Windows Computer class.

Fill in the path to the command as:
C:\Program Files\Internet Explorer\iexplore.exe  (Change to the x86 program files if you want the 32-bit IE)


Then comes the URL to the SSRS server and the property to pass from the SCSM console.
Let’s break the following URL down:
http://SSRS_SERVERNAME/LIVE_Reports/Pages/ReportViewer.aspx?%2fSystemCenter%2fServiceManager%2fServiceManager.Console.Reporting.AssetManagement%2fComputer+Receipt+Form&rs%3aCommand=Render&ComputerName=$Context/Property[Type='CustomMicrosoft_Windows_Library!Microsoft.Windows.Computer']/NetbiosComputerName$&rc:Parameters=false

·         This is the base URL to the SQL Reporting Server: http://SSRS_SERVERNAME/LIVE_Reports/Pages/ReportViewer.aspx
·         This is the path to the report you want to display:
?%2fSystemCenter%2fServiceManager%2fServiceManager.Console.Reporting.AssetManagement%2fComputer+Receipt+Form
·         This is the command to render the report:
&rs%3aCommand=Render
·         This is the command to pass a parameter to the report, in this case the “ComputerName” parameter:
&ComputerName=

This is where you use the “Insert Property” button in the create task wizard and select the property you require.
In this example I used the NetBIOS computer name property which returned:
$Context/Property[Type='CustomMicrosoft_Windows_Library!Microsoft.Windows.Computer']/NetbiosComputerName$

And finally add &rc:Parameters=false to the end of the command line to hide the parameter bar by default.
Review the summary and save finish the task wizard.
When you go to a view showing the class you targeted in the wizard, you should now see a new console task.

When you select an item and click the task, Internet Explorer should spawn, take you directly to the report and pass the report the parameter (NetBIOS Computer name in this example) and render the report ready for printing.

Friday, 9 July 2010

Chassis Type vs Model Name

We currently use WMI Query filters in our task sequences to make sure things like AD OU placement for mobile devices gets applied to the devices that need it.
These lists are starting to get a little long now, especially as we've had a larger turn over of different manufacutures in the last 18 months than we used to have.

So I was thinking the other day if there might be a better way and I remembered that WMI stores the chassis type in Win32_SystemEnclosure and that SCCM gathers this.

However... nothing is ever straight forward.
It turns out that just because there's a long list of different chassis types to choose from, the manufactures decided they would. Therefore when I expected to see lots of "Desktop" what I did see was "Desktop", "Pizza-Box", "Mini-Tower" etc.

The SQL Query below is a tidied up version that at least makes it reasonably easy to read. I'll post again when I've had chance to put this into a full report, probably with some more aggregation to just show Desktops, Mobile Devices & Servers.

SELECT v_R_System.Name0,
CASE WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '1' THEN 'Virtual' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '2' THEN 'Blade Server' WHEN
v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '3' THEN 'Desktop' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '4' THEN 'Low-Profile Desktop' WHEN
v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '5' THEN 'Pizza-Box' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '6' THEN 'Mini Tower' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0
LIKE '7' THEN 'Tower' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '8' THEN 'Portable' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '9' THEN
'Laptop' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '10' THEN 'Notebook' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '11' THEN 'Hand-Held'
WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '12' THEN 'Mobile Device in Docking Station' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '13'
THEN 'All-in-One' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '14' THEN 'Sub-Notebook' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '15' THEN
'Space Saving Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '16' THEN 'Ultra Small Form Factor' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0
LIKE '17' THEN 'Server Tower Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '18' THEN 'Mobile Device in Docking Station' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0
LIKE '19' THEN 'Sub-Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '20' THEN 'Bus-Expansion chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0
LIKE '21' THEN 'Peripheral Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '22' THEN 'Storage Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0
LIKE '23' THEN 'Rack-Mounted Chassis' WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 LIKE '24' THEN 'Sealed-Case PC' ELSE 'Unknown' END AS 'Chassis Type'
FROM v_R_System INNER JOIN
v_GS_SYSTEM_ENCLOSURE ON v_R_System.ResourceID = v_GS_SYSTEM_ENCLOSURE.ResourceID



Chassis TypeDisplay Name
1Virtual Machine
2Blade Server
3Desktop
4Low-Profile Desktop
5Pizza Box
6Mini Tower
7Tower
8Portable
9Laptop
10Notebook
11Hand Held
12Docking Station
13All-in-One
14Sub Notebook
15Space Saving Chassis
16Ultra Small Form Factor
17Server Tower Chassis
18Mobile Device in Docking Station
19Sub-Chassis
20Bus-Expansion Chassis
21Peripheral Chassis
22Storage Chassis
23Rack Mount Unit
24Sealed-Case PC


*Updated 27/01/2010* - Slight typo as I had 65 as Tablet PC, removed.  Also added easy read table.