Effective monitoring in SCOM


Do you work with System Center Operations Manager (SCOM)?  Wish you knew more about Windows PowerShell?  You're in the right place.

 

Occasionally, a customer requests a full list of the monitoring on a specific agent - all rules, monitors, thresholds, and overrides.  While the task called "Show Running Rules and Monitors for this Health Service" will be helpful, it does not show thresholds or overridden thresholds.

For this, you can use the PowerShell cmdlet: Export-SCOMEffectiveMonitoringConfiguration. Here's a sample script:

$Members = (Get-SCOMGroup –DisplayName "My SCOM group").GetRelatedMonitoringObjects()

$Members | ForEach-Object { Export-SCOMEffectiveMonitoringConfiguration –Instance $_ -Path "C:\thresholds\$($_.DisplayName).csv" –RecurseContainedObjects}

Take a few minutes to understand the script.  Look at the TechNet site for Export-SCOMEffectiveMonitoringConfiguration to understand the cmdlet's parameters, like "-RecurseContainedObjects."

I suggest testing this on a small group of agents first.  Once an agent is processed, a .csv file will appear in the path specified, "C:\thresholds\" in this example.

Once you've gotten the .csv files, you'll notice it's not very pretty - all the content is in the first column.  So to make things more usable and better looking, just do "Text to Columns" in Excel:

 

First, select the entire first column in the spreadsheet. Then, click "Text to Columns."

First, select the entire first column in the spreadsheet. Then, click "Text to Columns."

 

 

Use the pipeline character '|' as the delimiter.

Use the pipeline character '|' as the delimiter.

That's it!  Now you can send off this spreadsheet to whoever thought they really wanted to know the details of the hundreds of monitors and rules that were running on this agent 🙂

Note, this works in SCOM 2012/R2. I haven't yet tested it in 2016, but I think it will work. If you've tried it, please let me know!

Enjoy!

Comments (1)

Skip to main content