Welcome to TechNet Blogs Sign in | Join | Help

Outages and Maintenance Report

This is a little report I put together on request.

This report will query the data warehouse, and show all the outages, and maintenance, for objects in specific groups.

The outages look at all the “Failed to Connect to Computer” alerts, and list the start and end time of the outage, based on the time the alert was created, to the time it was closed (assumes it is auto-closed by the agent coming back online)

The maintenance looks at the times that the Health Service Watcher objects are placed into maintenance mode.

There is a start and end time parameters for the report – and the report defaults to the last 30 days.

There is a group choice parameter – you should pick a group that contains Health Service Watcher objects.

It looks like this:

image

It is based on this query, which you can tune to meet your needs:

declare @startdate datetime
declare @enddate datetime
declare @computergroups varchar(50)
SET @startdate = '2009-06-01 00:00:00.000'
SET @enddate = getutcdate()
set @computergroups = 'Agent Managed Computer Group'

select
apv.ParameterValue as SystemName,
(DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),av.RaisedDateTime)) as DownDateTime,
(DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),arsv.StateSetDateTime)) as RestoredDateTime,
adv.CustomField2 as OutageType,
adv.CustomField3 as RootCause,
adv.CustomField4 as Reason,
adv.DBLastModifiedByUserId as UserID
FROM Alert.vAlert av
JOIN Alert.vAlertDetail adv on av.AlertGuid = adv.AlertGuid
JOIN Alert.vAlertResolutionState arsv on av.AlertGuid = arsv.AlertGuid
JOIN Alert.vAlertParameter apv on av.AlertGuid = apv.AlertGuid
WHERE AlertName = 'Failed to Connect to Computer'
AND arsv.ResolutionState = '255'
--AND adv.CustomField2 IS NOT NULL
AND (DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),av.RaisedDateTime)) between @startdate and @enddate
and apv.ParameterValue IN (
SELECT vManagedEntity.DisplayName
FROM  vManagedEntity
INNER JOIN vRelationship ON vManagedEntity.ManagedEntityRowId = vRelationship.TargetManagedEntityRowId
INNER JOIN vManagedEntity AS ManagedEntity_1 ON vRelationship.SourceManagedEntityRowId = ManagedEntity_1.ManagedEntityRowId
WHERE (ManagedEntity_1.DisplayName = @computergroups)
)

UNION ALL

select
vme.displayname,
(DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),vmm.StartDateTime)) as DownDateTime,
(DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),vmm.EndDateTime)) as RestoredDateTime,
'OutageType' =
CASE
  vmm.PlannedMaintenanceInd
  WHEN '1' THEN 'Scheduled'
  WHEN '0' THEN 'Unscheduled'
END,
'RootCause' =
CASE
  vmmh.ReasonCode
  WHEN '0' THEN 'Other (Planned)'
  WHEN '1' THEN 'Other (Unplanned)'
  WHEN '2' THEN 'Hardware: Maintenance (Planned)'
  WHEN '3' THEN 'Hardware: Maintenance (Unplanned)'
  WHEN '4' THEN 'Hardware: Installation (Planned)'
  WHEN '5' THEN 'Hardware: Installation (Unplanned)'
  WHEN '6' THEN 'Operating System: Reconfiguration (Planned)'
  WHEN '7' THEN 'Operating System: Reconfiguration (Unplanned)'
  WHEN '8' THEN 'Application: Maintenance (Planned)'
  WHEN '9' THEN 'Application: Maintenance (Unplanned)'
  WHEN '10' THEN 'Application: Installation (Planned)'
  WHEN '11' THEN 'Application: Unresponsive'
  WHEN '12' THEN 'Application:  Unstable'
  WHEN '13' THEN 'Security Issue'
  WHEN '14' THEN 'Loss of network connectivity (Unplanned)'
END,
vmmh.Comment as Reason,
vmmh.userid as UserID
from vMaintenanceMode vmm
join vManagedEntity vme on vmm.managedentityrowid = vme.managedentityrowid
join vMaintenanceModeHistory vmmh on vmm.maintenancemoderowid = vmmh.maintenancemoderowid
where vme.FullName LIKE '%HealthServiceWatcher%'
and (DATEADD(hh,DATEDIFF(hh,getutcdate(),getdate()),vmm.StartDateTime)) between @startdate and @enddate
and vme.displayname IN (
SELECT vManagedEntity.DisplayName
FROM  vManagedEntity
INNER JOIN vRelationship ON vManagedEntity.ManagedEntityRowId = vRelationship.TargetManagedEntityRowId
INNER JOIN vManagedEntity AS ManagedEntity_1 ON vRelationship.SourceManagedEntityRowId = ManagedEntity_1.ManagedEntityRowId
WHERE (ManagedEntity_1.DisplayName = @computergroups)
)
ORDER BY DownDateTime

The report is attached below.

Published Thursday, June 11, 2009 5:48 AM by kevinhol
Filed under: , ,

Attachment(s): Outage and Maintenance Report.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Outages and Maintenance Report

Friday, June 12, 2009 1:55 PM by Nomad

Just ran it against some servers to test.  They were showing down for a total of around 3 hours over the last month and a half.

When we ran the availablity report against the HSWatcher for the same servers they showed 100% availability until we drilled down into the monthly view and saw May @ 99.86% and June @ 99.93% available.

I thought it was interesting.

# re: Outages and Maintenance Report

Sunday, June 21, 2009 10:26 AM by dmuscett

# re: Outages and Maintenance Report

Thursday, July 30, 2009 11:55 PM by Nathan

Thanks.  This report works like a charm and the bean-counters love it!

# re: Outages and Maintenance Report

Thursday, August 13, 2009 1:16 PM by Matthew Brown

Hi... has any one had a problem running the report after import. I modified the data source to match our environment, but am getting this error when I run the report: "An error has occurred during report processing. (rsProcessingAborted)

Query execution failed for data set 'ComputerGroups'. (rsErrorExecutingCommand)

For more information about this error navigate to the report server on the local server machine, or enable remote errors".

# re: Error

Thursday, August 13, 2009 1:31 PM by kevinhol

Each data set references my custom data source.... so you would need to edit your modified RDL and change each dataset section to reference your datasource name.

Sorry about that.... I totally didnt think to make this work directly on import.... using the built in warehouse data source.  I will fix it if I get some time.

# re: Outages and Maintenance Report

Thursday, August 13, 2009 2:15 PM by Matthew Brown

Kevin, Thank you so much for the rapid response. That was exacly my issue - thought I entered the correct data set and data source strings, but found a typo with the initial catalog portion of the string. Once I corrected the issue the report runs great. Your blog is great and your depth of knowledge of all things OpsMgr is amazing.

# re: Outages and Maintenance Report

Wednesday, September 23, 2009 2:18 PM by StDenis

Sorry, probably stupid question. How import this report to SCOM ?

# re: Outages and Maintenance Report

Thursday, September 24, 2009 6:42 AM by StDenis

Question revoke. Nice report, thanks.

# re: Outages and Maintenance Report

Friday, October 02, 2009 6:31 PM by Ryan

This report would be extremely helpful. Can you please tell me how to run this report? I dont mind doing the research I just need to have access to documentation. Point me in the direction and I will find it.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker