Collecting results of a Script as a Performance Counter

OdgeUK 41 Reputation points
2021-01-29T16:58:48.15+00:00

I want to present "Alerts Per Day" and "Number of Managed Agents" in SCOM, as a graph / performance line. This can also then be presented in SquaredUp.

The data is easy to obtain via direct SQL query on the SCOM DW, or by a simple script executed against the SDK on a management server (in the case of Managed Agents).

Is it relatively simple to create a Performance Counter that can be exposed in SCOM for this? Any pointers? Or is this a convoluted way to achieve this? I'm only collecting once per day, would this be overkill?

Seeing various examples of similar things, from authoring with the System.Performance.DataGenericMapper module, to using the 'Powershell Script Performance Collection Rule' (from the Community Powershell MP).

System Center Operations Manager
System Center Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,610 questions
0 comments No comments
{count} votes

Accepted answer
  1. CyrAz 5,181 Reputation points
    2021-01-29T17:30:38.263+00:00

    Your idea makes perfect sense, and while this is not possible from the console it is perfectly doable with a bit of authoring.
    Actually, the number of alerts is already collected and published as a perf counter out of the box by this rule : https://systemcenter.wiki/?GetElement=ManagementGroupCollectionAlertsCountRule&Type=Rule&ManagementPack=Microsoft.SystemCenter.OperationsManager.SummaryDashboard&Version=10.19.10050.0
    I'm not too sure about a "number of agents count" rule, but you can reuse the same principle as the Alert Count one fairly easily, even with limited authoring knowledge :)

    Or you could indeed use any other method, they are all relevant and basically rely on the same principle... if you try to untangle the chain of datasources used by both the ManagementGroupCollectionAlertsCountRule and the rules created by Cookdown Powershell MP, you'll see that they eventually end up using a Powershell scripted datasource and a Perf data mapper :)

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.