Best Practices: SCOM Health Check Script/Report OpsConfig ed v1.0

This weekend I came across a fantastic SCOM HealthCheck Script/Report written by Tim Culham of

I would strongly encourage you to visit the site and check out his original script as he did all the heavy lifting.

I decided to extend/tweak his script a bit by adding in a number of the more in depth SQL Queries that I frequently ask customers to run when troubleshooting performance issues with the OpsDB and DW. Many of the queries are modified versions of the KH Useful SQL Queries, though there are a few that might be new to all of you. This sacrifices some of the speed and elegance of Tim’s script, but the information that you get back is invaluable.

This script should be run as administrator from a SCOM Management Server by an account that has permissions to connect and read from the Ops & DW DBs. You can just run the script without inputting any parameters. It will open the report upon script completion. (My version can take anywhere from 30 seconds to 10 minutes to run depending on the size/performance of your environment)

*At times this script is running queries directly against the OpsDB -while this is a completely common practice for troubleshooting and diagnosing issues it is also technically not supported. The script is provided AS-IS without warranty of any kind*

My version of the script can be downloaded here:

What this version of the script will give you:(Some of these are just features which are carried over from the original, many are added)

01. Version/Service Pack/Edition of SQL for each SCOM DB Server
02. Disk Space Info for Ops DB, DW DB, and associated Temp DB’s
03. Database Backup Status for all DB’s except Temp.
04. Top 25 Largest Tables for Ops DB and DW DB
05. Number of Events Generated Per Day (Ops DB)
06. Top 10 Event Generating Computers (Ops DB)
07. Top 25 Events by Publisher (Ops DB)
08. Number of Perf Insertions Per Day (Ops DB)
09. Top 25 Perf Insertions by Object/Counter Name (Ops DB)
10. Top 25 Alerts by Alert Count
11. Alerts with a Repeat Count higher than 200
12. Stale State Change Data
13.  Top 25 Monitors Changing State in the last 7 Days
14. Top 25 Monitors Changing State By Object
15. Ops DB Grooming History
16. Snapshot of DW Staging Tables
17. DW Grooming Retention
18. Management Server checks (Works well on prem, seems to have some issues with gateways due to remote calls-if you see some errors flash by have no fear though I wouldn’t necessarily trust the results coming back from a Gateway server in the report depending on firewall settings)
19. Daily KPI
20. MP’s Modified in the Last 24 hours
21. Overrides in Default MP Check
22. Unitialized Agents
23. Agent Stats (Healthy, Warning, Critical, Unitialized, Total)
24. Agent Pending Management Summary
25. Alert Summary
26. Servers in Maintenance Mode

Report Output: (Only grabbing a screenshot of the first few pages as you get the basic idea)

Report Output

report output 2



Leave a Reply

Your email address will not be published. Required fields are marked *

The contents of this site are provided “AS IS” with no warranties, or rights conferred. Example code could harm your environment, and is not intended for production use. Content represents point in time snapshots of information and may no longer be accurate. (I work @ MSFT. Thoughts and opinions are my own.)