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 :)