This is a long standing question and is one of the top items often asked about Operations Manager. I discussed this topic in “Operations Manager Evolution” at MMS 2011 (shown below). The focus of this blog post is to update as to any options available and current links related to this topic in OpsMgr 2007 R2.

clip_image001

The following is a summary of tools available to determine what rules and monitors are running on servers in OpsMgr:

  • Effective Configuration Viewer
  • Get-ActiveRules
  • Show Running Rules and Monitors Task
  • Reports, PowerShell, SQL Queries
  • Overview of What’s Being Monitored
  • Silect Agent Explorer

Option: Effective Configuration Viewer. Download available at: http://www.microsoft.com/downloads/en/details.aspx?FamilyId=A9DB4DCA-6716-478D-89B9-42F27EBC76A8&displaylang=en

Issues: Per discussion here and on Marnix’s blog the Effective Configuration Viewer is not 100% accurate since the R2 release.

Details: Screenshot of the application shown below connected to a specific servers in the environment:

clip_image003

Option: Get-ActiveRules.ps1. Original download available at: http://poshcode.com/454. This script actually runs the task below (Show Running Rules and Monitors for this Health Service task) but it does so via PowerShell so it could be run for many different systems. An updated version of this code is at the end of this blog post.

Issues: Updated this script as it wasn’t working for me in my OpsMgr 2007 R2 environment. This script now takes only one parameter which is the name of the server and it writes files to the c: location.

Details: A screenshot of this powershell script is shown below running for servers specified in an input file (c:installserverlist.txt).

image

Option: Reports, PowerShell, SQL Queries. Graham’s writeup of available at: http://systemcentersolutions.wordpress.com/2009/09/10/how-do-i-know-what-rules-or-monitors-are-running-on-an-agent/

Issues: Good information on how to export management pack information but no additional options are listed which provide another option for rules and monitors which are running in the environment.

Option: Show Running Rules and Monitors for this Health Service task. (Available in the OpsMgr console Monitoring Pane / Operations Manager / Agent / Agent Health State view).

Issues: In my limited testing this action crashed in the OpsMgr console in OpsMgr R2 (non-CU5). In R2 CU5, this task runs, but may crash when attempting to do the “Copy HTML” function.

Details: A screenshot of this task is shown below:

clip_image004

 

Option: Overview of What’s Being Monitored. Marnix’s Excel option information available at: http://thoughtsonopsmgr.blogspot.com/2011/02/scom-r2-what-is-being-monitored-by-it.html

Issues: This is an extremely cool idea but it would be manually intense to create this for an environment. This also does not show specific rules or monitors, but groups of functionality. This does however point towards where this question may need to go to be answered in the future – Excel services.

Details: A screenshot of this approach in  below:

clip_image006

Option: Silect Agent Explorer. Trial version available at: http://www.silect.com/content/form-request-trial

Issues: This is the most professional solution available but it is a third party product which would need to be purchased for your environment.

Details: Silect has provided a video on how their product does this which is available at: http://www.silect.com/static/MPLearn/MPL09_AgentAnalyzer/WhatsRunningOnAgent.mp4

Summary: There are lots of different ways to attack this are out there but which one you want will depend upon what you are looking for.

Additional Reading:

 

Graham’s article on this: http://systemcentersolutions.wordpress.com/2009/09/10/how-do-i-know-what-rules-or-monitors-are-running-on-an-agent/

Marnix’s article on this: http://thoughtsonopsmgr.blogspot.com/2011/02/scom-r2-what-is-being-monitored-by-it.html (Overview of what’s monitored where in OpsMgr)

Get-ActiveRules.ps1

## Get-ActiveRules grabs the workflows running on the specified server
## Author: Jeremy D. Pavleck – Jeremy@Pavleck.NET
##        Cameron Fuller – updated to work in my OpsMgr R2 environment
## Requires: The Microsoft.SystemCenter.Internal.Tasks.mp on the SP1 CD
## Notes: You can find this task inside the console by going to monitoring, computers and under “Agent Health State” run
##  “Show Running Rules and Monitors for this Health Service” for this object.
## NOTE: This script now only accepts one parameter – the FQDN of the entity to run this task on and writes to the c: directory

function Get-ActiveRules ([string]$server) {

# Write-Host “In Get-ActiveRules for $server” -ForeGroundColor Magenta

If (!$location) { $location = “C:$server-Rules.xml” }
# Create the Task object
$taskobj = Get-Task | Where-Object {$_.Name -eq “Microsoft.SystemCenter.GetAllRunningWorkflows”}

# Make sure we have it, if not, the MP isn’t installed.
If (!$taskobj) {
Write-Host “Unable to find required monitoring tasks – MS System Center Internal Tasks MP needs to be installed.” -ForeGroundColor Magenta;
break;
}

# Grab HealthService class object
$hsobj = Get-MonitoringClass -name “Microsoft.SystemCenter.HealthService”

# Find HealthService object defined for named server
$monobj = Get-MonitoringObject -MonitoringClass $hsobj | Where-Object {$_.DisplayName -eq $server}

Write-Host “taskobj = $taskobj”
Write-Host “hsobj = $hsobj”
Write-Host “monobj = $monobj”
Write-Host “server = $server”

$taskOut = Start-Task -Task $taskobj -TargetMonitoringObject $monobj

# See if it worked, if it did, export out the OutPut part and save as an XML file, then display some items.
If ($taskOut.ErrorCode -eq 0) {
[xml]$taskXML = $taskOut.OutPut
$ruleCount = $taskXML.DataItem.Count

Write-Host “Succeeded in gathering rules for $server” -ForeGroundColor Green
Write-Host “Currently $ruleCount rules active.” -ForeGroundColor Green
Write-Host “Exporting to $location” -ForeGroundColor Green

$taskOut.OutPut | Out-File $location
} else {

Write-Host “Error gathering rules for $server” -ForeGroundColor Magenta
Write-Host “Error Code: ” + $taskOut.ErrorCode -ForeGroundColor Magenta
Write-Host “Error Message: ” + $taskOut.ErrorMessage -ForeGroundColor Magenta
}

} # End Get-ActiveRules
#######################

foreach ($srv in Get-Content “C:InstallServerList.txt”)

{

write-host “ServerList is $srv”

Get-ActiveRules($srv)

}

ServerList.txt (sample)

OPSDASH.Odyssey.local
Hydra.Odyssey.local

Populating the ServerList.txt file

The ServerList.txt file can be populated via PowerShell. The example below exports the agent information to a CSV file. This file can be opened in Excel and the PrincipalName field can be copied to create the ServerList.txt file.

get-agent | export-csv –notype c:scomagents.csv