Run custom discovery using a custom resource pool

Morrison, Vance 21 Reputation points
2022-01-18T17:53:54.037+00:00

I've created a custom discovery that is working as expected. However I would like to target a specific resource pool to run the discovery. I know I can target it to the all management servers pool, but I don't want to install the powershell modules required for the discovery on all of the management servers. Does anyone know where I can find the documentation on to do this?

All management servers: Target="SC!Microsoft.SystemCenter.AllManagementServersPool"

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,602 questions
0 comments No comments
{count} votes

Accepted answer
  1. CyrAz 5,181 Reputation points
    2022-01-19T09:04:53.63+00:00

    Short answer : it depends. You're welcome :p

    Longer answer :
    A resource pool is "just" an instance of a class like mostly everything else in SCOM, but there is a slight difference between most of "out of the box" Resource Pools (All Management Servers, AD Assignment, Notification...) and the ones you create through the GUI.
    Out of the box ones are based on what's called a "Singleton Class". Said otherwise, they have their own class and only one instance of that class can exist. So All Management Servers is Microsoft.SystemCenter.AllManagementServersPool, AD Assignment is Microsoft.SystemCenter.ADAssignmentResourcePool, Notification is Microsoft.SystemCenter.NotificationsResourcePool etc.
    They all use Microsoft.SystemCenter.ManagementServicePool as their Base Class, and since they are Singleton classes they do not need to be discovered : their sole instance simply "exists" just by declarating their ClassType.
    And because each of them is a distinct class, it's easy to target a discovery at them.

    However, the resource pools that you create through the GUI are all instances of the same class called Microsoft.SystemCenter.ManagementServiceRuntimePool. Said otherwise, if you target a discovery at that class, it will run on all resource pools that were created through the GUI.
    You can think of it in the same way as you would for Windows Servers : you have many instances of the Microsoft.Windows.Computer classes in your environment, and if you target a discovery at that class it will run on all of them. If you want a more precise target for your discovery, you need a more specific class.

    So the easiest way to achieve what you want is to create your own Resource Pool singleton class inside your custom MP. You can have a look at how Daniele Grandini did it in his OMS MP for example : https://github.com/QuaeNocentDocent/OMS-ManagementPack/blob/master/QND.OMS/Pool.mpx

    And then you'll be able to target your discovery at your custom Resource Pool class :)

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Morrison, Vance 21 Reputation points
    2022-01-19T14:14:55.36+00:00

    Thanks for the reply CyrAz.

    What I did yesterday after posting was added the following line and then used it as the target and that appears to work in our dev environment. I wanted to double check this is correct before doing it in production.

    <ClassType ID="REMOVED.Patching.Automation.Pool" Accessibility="Public" Abstract="false" Base="SC!Microsoft.SystemCenter.ManagementServicePool" Hosted="false" Singleton="true" Extension="false" />

    When I try inside of MPStudio to add the target to the discovery, it crashes MPStudio. If what I've done above is correct, I'll open a ticket with support.

    0 comments No comments

  2. CyrAz 5,181 Reputation points
    2022-01-19T14:48:02.407+00:00

    That's basically what is done in the OMS MP, except it also has a discovery for the associated Pool Watcher which you should add as well.
    But not having it should never crash MPStudio.

    0 comments No comments

  3. CyrAz 5,181 Reputation points
    2022-01-20T11:45:18.863+00:00
    0 comments No comments

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.