CMDB Health Dashboard and Discovery - Include Only Principal Classes

Maurice Murphy
Tera Guru

My organization is currently in the process of standing up Discovery, and while the initial stand-up of the service in our DEV environment has been successful, we are running into some issues with the CMDB Health Dashboard and its results. There is an ask that the health dashboard should only include health results for Principal Classes, however the only way I have found to "exclude" classes from the dashboard is to create a health inclusion rule along the lines of "Include if Sys ID is empty". 

 

Because the rule is never true, these items will never appear in the health dashboard, and while this has worked, it is a very manual and time consuming process to go through each non-principal class and add that rule. 

 

Is there an OOTB way to automatically exclude non-principal classes from the CMDB health scan results? 

6 REPLIES 6

AndyLock
Mega Guru

The Principal Class flag is a great feature, but it appears to be currently unsupported by Health Inclusion rules. I would love to see a simple check-box at the cmdb_ci level that would automatically include all principal classes.

I absolutely agree! It would be wonderful if the health dashboard had an option or filter to only focus on Principal Classes, just like there is the option on the CI table itself to only show those CI's. Maybe it's an opportunity to submit to the Idea Portal?

jnheard
Tera Contributor

I figured out the trick to this with a little help from SN Utils a few weeks ago.
First of all, get SN Utils. It's just a fantastic browser plugin.

Then you will need to change the Inclusion condition to use Condition builder v2 so that you can paste in the Principal CI javascript.

 

Now do the following:

    1. Navigate to CI class manager > configuration items > health > inclusion rules
    2. Create new rules that applies to cmdb_ci with for desired metrics. Save record
       - Right click on inclusion condition and select the option to configure the dictionary
       - Add this text to the attribute without the quote marks: 'condition_builder=v2'. Save record.
       - Return to previously created inclusion rules.
    3. Open each rule and complete the following:
       -->Double click on inclusion condition to open SN Utils
       -->Replace existing text with sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()

               - This is where SN Utils is useful, it's the only way I know to force the condition operator to be blank.
       -->Add other conditions like install status exclusions to fit your needs.Inclusion Condition Attribute.pngHealth Metric Inclusion Condition.png

I'll have to give this a try in our Sandbox instance! Thanks so much for the tip. If it works as expected I'll accept this as the solution!