Prevent Discovery from creating certain CI classes

JADrisko
Tera Contributor

How do you prevent the unwanted CI’s from being created by Discovery when using the new Discovery Patterns?

With the transition to Patterns as part of Discovery it appears that the mechanism that I used to use to disable Discovery from creating unwanted CI’s (e.g. Memory Module, Windows Service, Disk, Patch, etc.) no longer works. I used to employ a Business Rule that would abort the insert of the new CI record:

(function executeRule(current, previous /*null when async*/) {

var sysClass = gs.getProperty('discovery.ci_classes_creation_restrict.discovery').toString();
sysClass=sysClass.split(',');
if(sysClass.indexOf(current.sys_class_name)>-1)
//gs.log("@@Inside if "+current.sys_class_name.toString());
current.setAbortAction(true);

})(current, previous);

But now with a new London instance, that uses Patterns, a Windows server discovery will not complete and create the Windows server CI because of the it doesn’t appear to like that I tried to prevent the unwanted CI’s from being created in the CMDB:

2018-12-21 13:15:59: Identification CI Errors:
Insertion failed with error Operation against file 'cmdb_ci_file_system' was aborted by Business Rule 'BR_disable_creation_via_discovery^0110bf09dbe6e7004f80de82ca9619e1'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_file_system' was aborted by Business Rule 'BR_disable_creation_via_discovery^8910bf09dbe6e7004f80de82ca9619e2'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_file_system' was aborted by Business Rule 'BR_disable_creation_via_discovery^4d10bf09dbe6e7004f80de82ca9619e3'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_file_system' was aborted by Business Rule 'BR_disable_creation_via_discovery^0110bf09dbe6e7004f80de82ca9619e5'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_file_system' was aborted by Business Rule 'BR_disable_creation_via_discovery^c110bf09dbe6e7004f80de82ca9619e6'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_config_file_tracked' was aborted by Business Rule 'BR_disable_creation_via_discovery^c910bf09dbe6e7004f80de82ca9619e8'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_config_file_tracked' was aborted by Business Rule 'BR_disable_creation_via_discovery^0510bf09dbe6e7004f80de82ca9619ea'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_config_file_tracked' was aborted by Business Rule 'BR_disable_creation_via_discovery^0910bf09dbe6e7004f80de82ca9619eb'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_config_file_tracked' was aborted by Business Rule 'BR_disable_creation_via_discovery^0d10bf09dbe6e7004f80de82ca9619ec'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'dscy_route_interface' was aborted by Business Rule 'BR_disable_creation_via_discovery^0110bf09dbe6e7004f80de82ca9619ee'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_disk_partition' was aborted by Business Rule 'BR_disable_creation_via_discovery^1910bf09dbe6e7004f80de82ca9619ef'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_disk_partition' was aborted by Business Rule 'BR_disable_creation_via_discovery^1d10bf09dbe6e7004f80de82ca9619f0'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_disk_partition' was aborted by Business Rule 'BR_disable_creation_via_discovery^1d10bf09dbe6e7004f80de82ca9619f1'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_memory_module' was aborted by Business Rule 'BR_disable_creation_via_discovery^1d10bf09dbe6e7004f80de82ca9619f2'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'dscy_route_next_hop' was aborted by Business Rule 'BR_disable_creation_via_discovery^1110bf09dbe6e7004f80de82ca9619f4'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_disk' was aborted by Business Rule 'BR_disable_creation_via_discovery^1910bf09dbe6e7004f80de82ca9619f5'. Business Rule Stack:BR_disable_creation_via_discovery,Insertion failed with error Operation against file 'cmdb_ci_disk' was aborted by Business Rule 'BR_disable_creation_via_discovery^5510bf09dbe6e7004f80de82ca9619f7'. Business Rule Stack:BR_disable_creation_via_discovery


Identification Relation Errors:
Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error,Insertion failed with error

4 REPLIES 4

vNick
ServiceNow Employee
ServiceNow Employee

Have you tried using the configuration console for discovery?  It won't be as flexible as it use to be, and relies on some of the data collection happening from shared libraries used by patterns (as it will disable them), but may be worth a try as it's best to control this from the initial collection design versus trying to catch it in a BR or clean-up after.

You could copy the OOTB pattern to you own and then tweak what is collected within the pattern (i.e. remove steps or libraries).  There are a lot of relationships between CI's created during this process, so just beware of removing something without also removing the attempts to create relationships to it.

 

https://docs.servicenow.com/bundle/kingston-it-operations-management/page/product/discovery/concept/c_DiscoveryConfigurationConsole.html 

JADrisko
Tera Contributor

Unfortunately using the Configuration Console doesn't address use case I have.  While it does prevent some of the CI's from being created it also prevents the desired CI's from having all the necessary information.

For example, disabling "Unix CPU & Memory" on the console does prevent Memory Module CI's from being created it also prevents the "RAM" (cmdb_ci_linux_server.ram) attribute from having a values filled in.

The Business Rule approach that I used to use with the old Sensors & Probes worked perfectly because the server CI attributes would be filled in, but the unnecessary CI's such as Memory Module, Windows Service, and Disk wouldn't be created in the CMDB.

vNick
ServiceNow Employee
ServiceNow Employee

I agree that it doesn't get that granular, so a couple things... first, making an enhancement request in HI will get some eyes on adding granularity to the configuration console.

Second, you can see in the screenshot below that the "Linux Server" pattern is made up of many shared libraries... one being Memory Modules.  You could test a couple routes to see if you get the desired outcome.  One way is to duplicate the "Linux Server" pattern and then you can remove the step that calls the Memory Module library so that it doesn't collect that data, two, you could deactive the Memory Module share library pattern so it won't execute.  I think most would say the first approach is better so that the shared library will still execute in other places should it be necessary.

find_real_file.png

karthikyk
Tera Contributor

@JADrisko  were you able to disable discovery of unwanted CI's? please let me know