Analyzing running workflows on a SCOM Agent (HealthService)
Today I was asked: How do I get a usable list of all workflows running on a SCOM Agent? That’s easy, I thought: that’s why we have the built-in task “Show Running Rules and Monitors for this Health Service” for:
Unfortunately, the output is not really easy to understand and to process. Therefore I created a small function Get-SCOMHealthServiceWorkflowInformation which uses the same task, but provides a better output:
- It saves the task output as clean XML, which allows further processing
- It enriches the workflow information found on the HealthService with these information:
- Type of workflow: Rule, Monitor, Discovery
- Internal name and Display name of workflow
- Internal name and Display name of target Object and Objectclass
- Internal name, Display name and version of Management Pack where the workflow originates from
- It stores the custom workflow objects in a CSV file for later analysis.
The function has a built-in command based help, but here comes one usage example:
PS C:\> Get-SCOMHealthServiceWorkflowInformation -HealthServiceName scom2012-dc.scom2012.local -ExportTaskOutputXML -SaveWorkflowObjectsAsCSV –Verbose
The function can create two output files:
It allows you to answer e.g. these questions:
- How many workflows of which type are running on the Agent?
- How many objects (Class instances) are discovered on the Agent?
- Which MP has running Workflows on this Agent?
You can download the function at TechNet Gallery here.