'Discovery source' field is empty for cmdb_ci_spkg CI after Discovery is complete

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

Dear Community,

as I haven't found the clear answer to the question, decided to raise it again here. After I complete the WMI Discovery for Windows Servers, I've got server CIs created together with multiple related CIs. All the CIs are populated with 'Discovery Source' = 'ServiceNow', but Software (cmdb_ci_spkg) remains empty.

Did anyone change the default sensors and can advise what exactly must be adjusted in order to set  'Discovery Source' = 'ServiceNow' for Software CIs (cmdb_ci_spkg)? I know there is a sensor called 'Windows - Installed Software', that does 

this.addToRelatedList('cmdb_ci_spkg', filteredPackages, '', '');

 but after checking 'filteredPackages' variable and called 'InstallSoftwareFilter' script include, I still couldn't identify the line to set the discovery source field.

Appreciated for the help.

7 REPLIES 7

Venky VA
ServiceNow Employee
ServiceNow Employee

yes for cmdb_ci_spkg dsicovery source is not populated.

you can add step to set discovery type concerned pattern[refer screen shot to discovery type]

 

SiD2
ServiceNow Employee
ServiceNow Employee

Hi @Venky @Pavlo Rudenko,

I guess the discovery type is different from discovery source, this will give you discovery type whether horizontal/service mapping but discovery source has ServiceNow or ServiceWatch etc..

I guess the discovery source is set in the discovery flow by the discovery engine and not handled in patterns.

Please mark Helpful / Accept Solution so that it helps others with similar questions.

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

Right, 'Discovery Source' field is set in the Script Includes, like 'DiscoveryIDSensor'. The challenge is to find out, how this can be aligned to cmdb_ci_spkg class discovery.

Venky VA
ServiceNow Employee
ServiceNow Employee

Sorry my bad i thought you are looking for discovery type.

You can this line to your script include to populate discovery source .

var sourceName = gs.getProperty('glide.discovery.source_name', "ServiceNow");

Then you need to set the source using glide record api