SCOM Authoring: Class Relationships help

Roger 21 Reputation points
2020-11-23T21:09:58.823+00:00

Hi all

I have an understanding problem, maybe you can help me :)

I have this classes:

<ClassType ID="MyApp.Class" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" Extension="false">
 <Property ID="Function" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
 <Property ID="Stage" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
</ClassType>
<ClassType ID="MyApp.Role1.Class" Accessibility="Public" Abstract="false" Base="MyApp.Class" Hosted="true" Singleton="false" Extension="false" />
<ClassType ID="MyApp.Role2.Class" Accessibility="Public" Abstract="false" Base="MyApp.Class" Hosted="true" Singleton="false" Extension="false" />
<ClassType ID="MyApp.Role3.Class" Accessibility="Public" Abstract="false" Base="MyApp.Class" Hosted="true" Singleton="false" Extension="false" />

I have a server A which is Role1 and also Role2. If a monitor which is targeted to Role1 is "Unhealthy", the Role2 instance of server A is also Unhealthy because of this monitor.
I don't understand this. I think it has something to do with the hosting relationship. For me it would be logic if MyApp.Role1.Class is critical and it rollups up to the Base class "MyApp.Class", but I have no clue why also the Role2 instance is critical. When I open the Health Explorer on the instance of Role2, I see the monitors for Role1.

Can somebody explain me, why this happens and maybe a way how to set only the Role1 instance to "critical"?

I also tried to set the Base from ComputerRole to ApplicationComponent, but than nothing worked anymore :/

Any Input would be very appreciated

Thank you

Kind regards
Roger

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

Accepted answer
  1. CyrAz 5,181 Reputation points
    2020-11-29T12:10:48.713+00:00

    Another issue I found is that you didn't set a key property on the root class.
    Since you can't discover more than one instance of a class on a given server if that class doesn't have a key property, that was also a part of this issue.
    So, with a key property and no discovery for the root class, that's the result I get and it looks much more "normal" to me :
    43513-image.png

    I've attached a "fixed" version of your troubleshooting MP if you want to check out the changes I made. Note that you will have to delete the old version first, if you simply update it with my version you'll likely face a few issues.

    43437-troubleshootmp.xml

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. CyrAz 5,181 Reputation points
    2020-11-23T22:56:17.703+00:00

    Could you show us the full code of this management pack?

    0 comments No comments

  2. Roger 21 Reputation points
    2020-11-23T23:06:12.923+00:00

    42016-mycompanymyappmp.xml
    Hi Cyril

    I uploaded it, thanks for checking it out.

    0 comments No comments

  3. Roger 21 Reputation points
    2020-11-26T17:40:23.2+00:00

    I have created a small sample MP, which you can import to see the error.
    Run these two commands on a server where you want to see this behaviour (needed for discovery):
    New-Item -Path HKLM:\SOFTWARE\SCOMTroubleshoot
    New-ItemProperty -Path HKLM:\SOFTWARE\SCOMTroubleshoot -Name Function -Value "Role1, Role2" -PropertyType String

    In the attachment (42999-troubleshootmp.xml) is the MP, if you import it you have a folder Troubleshoot with three state views, foreach class one.
    There is also a monitor with target on Role1 which always fails for showing the problem.

    As you can see, Role1 and Role2 are red. How can I achieve that only Role1 one is red?

    Thank you very much for helping :)

    --------------------------
    Edit:

    I had to use everywhere Windows!Microsoft.Windows.ComputerRole as Baseclass, then it worked:

    <ClassType ID="MyApp.Class" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" Extension="false">  
      <Property ID="Function" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />  
      <Property ID="Stage" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />  
     </ClassType>  
     <ClassType ID="MyApp.Role1.Class" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" Extension="false" />  
     <ClassType ID="MyApp.Role2.Class" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" Extension="false" />  
     <ClassType ID="MyApp.Role3.Class" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" Extension="false" />  
    

    Still don't understand why my first version not works. If someone as han explanation, I'm all ears :)

    0 comments No comments

  4. CyrAz 5,181 Reputation points
    2020-11-29T01:00:32.07+00:00

    I've tried your Test MP and I'm witnessing the same behavior as you do.
    I'm not entirely sure of the logics behind it, but the root cause is pretty clear : you shouldn't discover instances of a "parent" class and of classes that inherit from it on the same server.
    It looks like Role1 rolls up to the root class (which is expected), and then that it "goes back down" to role2 somehow...

    0 comments No comments