Populate "Datasource History" table with SCCM Integration

Gaetano De Mitr
ServiceNow Employee
ServiceNow Employee

Hello to all,

I need to populate the cmdb_datasource_last_update table when a Computer is created by SCCM integration, since not populating this table (cmdb_datasource_last_update), the rules of Datasource Precedence and Reconciliation Definitions do not work. As a better approach, what do you recommend:

  • Create an onBefore Transform script on the following SCCM Transform "SCCM 2012 v2 Computer Identity", using the IRE API, or
  • do an insert BR, "onAfter" on the cmdb_ci_computer table that populates the records in the "cmdb_datasource_last_update" table by setting Datasource = SCCM?

My aim is to give SCCM absolute priority over Computers (Workstations) on any field

Furthermore, since to date there are already Computers created by SCCM but without recond in the "Datasource History" table, I imagine an initial remediation should be done on the AS-IS.

Do you agree?

16 REPLIES 16

Yes you are correct with support recommending not to update SCCM to go via IRE, but I have done so in the past and seen no issues. The only reason I needed to do so if to use Datasource Precedence and Reconciliation Definitions since client wanted SCCM and disco for same devices. 

When updating the SCCM transfer maps to use IRE, You leave the mapping entries as is, but move the scripted stuff to mapped entries. The code via doc site on how to use IRE via import sets will loop through the map entries to pull that data out and convert to the JSON payload needed for IRE API. 

I do not think the rules even look at cmdb_datasource_last_update. I could be wrong but Ill need to review source code again. 

I ensute you(because I'm testing It) that datasource precedence and Reconciliation def using datasource history table to work good. So, consider that I dont use Discovery and SCCM for same CI. I would like register the Computer(workstation) using Only SCCM and not Discovery. How can I disable computer Discovery by ServiceNow Discovery ? Do should I disable same probe?

Are the workstations on their on subnet? If so, then don't have discovery run on that subnet. If not, then yes you can disable the trigger under the windows classification to kick them off, but I don't like to recommend that since discovery is suppose to find what is unknown and known. What are you trying to stop one source over the other from updating?

I'm trying to ensure that Discovery does not go to overwrite the computers registered on the CMDB by SCCM. The latter, for workstations, must have absolute priority over any source. the main problem is that if not generating records in the "Datasource History" table, when SCCM creates a workstation on CMDB, if it is detected by Discovery, it will be overwritten. Just this should be avoided.

 

The Classic functionality ti set specific pripritization between datasource should be implemented using directly datasource precedence and Reconciliation definitions.

 

Have you come up with a solution yet? Did you go with BR or onafter?