CMDB Health Dashboard and Discovery - Include Only Principal Classes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2023 09:55 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 08:37 AM - edited ‎10-16-2023 08:43 AM
Brilliant! That seems to be working.
I have a few simple tips that might further help:
1) Using SN Utils you can, of course, paste more complex conditions as an encoded query. For example:
sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()^install_statusIN3,1
2) You can navigate directly to the CMDB Health Configuration table from cmdb_health_config.list
From here you can add/edit all the inclusion rules by stepping through them, rather than having to navigate to each rule from CI Class Manager.
3) if you don't have SN Utils you can export the XML of your inclusion rules (using Update Set Utility?), edit the active_record_condition as per the below example, then "Import as XML" from any list view.
a) The encoded query should include sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses(), along with any other conditions
b) the item for field="sys_class_name" needs to be update to: value="javascript:new PrincipalClass().getPrincipalClasses()" operator="IN"
Example Before edit
<active_record_condition table="cmdb_ci">
sys_class_nameINSTANCEOFcmdb_ci_appl_dot_net^install_statusIN3,1
<item goto="false" or="false" field="sys_class_name" endquery="false" value="cmdb_ci_appl_dot_net" operator="INSTANCEOF" newquery="false"/>
<item goto="false" or="false" field="install_status" endquery="false" value="3,1" operator="IN" newquery="false"/>
</active_record_condition>
Example After edit
<active_record_condition table="cmdb_ci">
sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()^install_statusIN3,1
<item goto="false" or="false" field="sys_class_name" endquery="false" value="javascript:new PrincipalClass().getPrincipalClasses()" operator="IN" newquery="false"/>
<item goto="false" or="false" field="install_status" endquery="false" value="3,1" operator="IN" newquery="false"/>
</active_record_condition>
4) You can navigate directly to the CMDB Class Information table from cmdb_class_info.list
From here you can easily view/edit the principal classes in a list.
EDIT***
Above text is automatically edited. Please ensure you are pasting
javascript:new PrincipalClass().getPrincipalClasses()
not
sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2025 04:26 PM
Wouldn't it be nice if you could use the filter editor to add: Class is (dynamic) Principal Class?
Sorry to disappoint.
But if you think it's a good idea, vote for it!
Dynamic Filter Option for CMDB Class is (dynamic) Principal Class