Understanding why IRE isn't matching on Identification Rule

MarkyMark1
Tera Expert

I'm trying to understand why the IRE doesn't believe there's a CI match when from my point of view it appears there should be.   I'm running the Identification Simulation on a simple payload.

find_real_file.png 

If you look at the network adapter class there is indeed a matching CI with the same mac address and name.

find_real_file.png

The CI identifier shows the valid entry used to determine such a match.

find_real_file.png

Yet the Output Payload finds no match and therefore wants to instead insert a new record.   What am I missing here?  thanks!find_real_file.png

1 ACCEPTED SOLUTION

Not applicable

You will need to check cmdb_rel_ci.

The dependent relationship is defined as such:

find_real_file.png

Showing hardware as the parent, Owns::Owned By as the relationship type, and network adapter as the child.

The best way would be to go to cmdb_rel_ci.list to view relationships.  Add a filter where 'Type' is 'Owns::Owned By' and 'Child' is your network adapter's name.

If there is not a relationship in that query where the parent is your ROF... linux server then the relationship doesn't exist.

 

View solution in original post

8 REPLIES 8

Sandeep90
ServiceNow Employee
ServiceNow Employee

I have tried the same sample payload on an Out of box instance and it is doing a match on the rule with no change when retried with the same payload. Can you please check the dependent relationships that are on the network adapter? You can enable IRE debug logging and run through a simulation to find more information in the logs on why it's not matching.

Thanks so much.  Since I'm not seeing the behavior you stated in your reply and so we are on the same page, I've decided to follow your lead with an example using my own personal instance / oob.

So looking at the OOB network adapters.

 

find_real_file.png

 

This time I will use the background script described in SN's https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0793220 docs.

var payload = {
  "items": [
    {
      "className": "cmdb_ci_network_adapter",
      "lookup": [],
      "values": {
        "mac_address": "11:22:33:44:55:66",
        "name": "eth0"
      }
    },
    {
      "className": "cmdb_ci_win_server",
      "lookup": [],
      "values": {
        "name": "V-W2K3-32-Web02"
      }
    }
  ],
  "relations": [
    {
      "type": "Owns::Owned by",
      "parent": 1,
      "child": 0
    }
  ]
};

var discoverySource = "ServiceNow";
var output = SNC.IdentificationEngineScriptableApi.createOrUpdateCI(discoverySource, JSON.stringify(payload));
gs.print(output);

Now if you look at the debugging output (sorry about the size)

 

identification_engine                 : isDependency: checking if cmdb_ci_win_server is a dependency for cmdb_ci_network_adapter
identification_engine                 : isDependency: looking through hosting for cmdb_ci_network_adapter
identification_engine                 : isDependency: RESULT: match through hosting Owns => cmdb_ci_hardware
identification_engine                 : IdentificationEngine::process: Pass=1
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:c12f9be8c3400200d8d4bea192d3aea6|cmdb_ci_hardware|cmdb_serial_number|[serial_number, serial_number_type]] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:fb27f69cc3000200d8d4bea192d3ae67|cmdb_ci_hardware|[serial_number]] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:556eb250c3400200d8d4bea192d3ae92|cmdb_ci_hardware|[name]] MATCHED
identification_engine                 : IdentificationEngine::process: Pass=2
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:38827e660f369200a52afa6ce1050ef5|cmdb_ci_network_adapter|[mac_address, name]] NO_MATCH
identification_engine                 : getDependentCI: checking record 0 with rule mac_address,name
identification_engine                 : createOrUpdateCI: Matched 2 records and 1 relations in 133msec
identification_engine                 : Restart for INSERT : cmdb_ci_network_adapter : com.snc.cmdb.identify_reconcile.RecordCommitterForCi
identification_engine                 : Generated Mutex key with MD5 Hash: IDENTIFICATION_ENGINE_n8E4qivR2JSGgTmTKQfdLw== for name: DID=e28b05a09f030200fe2ab0aec32e70bc/cmdb_ci_network_adapter/mac_address=11:22:33:44:55:66
identification_engine                 : Generated Mutex key with MD5 Hash: IDENTIFICATION_ENGINE_YJ0tLNxrEneRyclkAytmxA== for name: DID=e28b05a09f030200fe2ab0aec32e70bc/cmdb_ci_network_adapter/name=eth0
identification_engine                 : Trying to acquire lock for IDENTIFICATION_ENGINE_YJ0tLNxrEneRyclkAytmxA==
identification_engine                 : Acquired lock for IDENTIFICATION_ENGINE_YJ0tLNxrEneRyclkAytmxA==
identification_engine                 : Waited 14msec for mutex named IDENTIFICATION_ENGINE_YJ0tLNxrEneRyclkAytmxA==
identification_engine                 : Trying to acquire lock for IDENTIFICATION_ENGINE_n8E4qivR2JSGgTmTKQfdLw==
identification_engine                 : Acquired lock for IDENTIFICATION_ENGINE_n8E4qivR2JSGgTmTKQfdLw==
identification_engine                 : Waited 8msec for mutex named IDENTIFICATION_ENGINE_n8E4qivR2JSGgTmTKQfdLw==
identification_engine                 : Executed for 273msec before acquiring all mutexes
identification_engine                 : Encountered an insert during delay locking, restarting processing under lock
identification_engine                 : IdentificationEngine::process: Pass=1
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:c12f9be8c3400200d8d4bea192d3aea6|cmdb_ci_hardware|cmdb_serial_number|[serial_number, serial_number_type]] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:fb27f69cc3000200d8d4bea192d3ae67|cmdb_ci_hardware|[serial_number]] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_win_server","values":{"discovery_source":"ServiceNow","name":"V-W2K3-32-Web02"},"internal_id":"48de302b8801011044d23ff3a95f3f47","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:556eb250c3400200d8d4bea192d3ae92|cmdb_ci_hardware|[name]] MATCHED
identification_engine                 : IdentificationEngine::process: Pass=2
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [sys_object_source] SKIPPED
identification_engine                 : addAttempt [{"className":"cmdb_ci_network_adapter","values":{"discovery_source":"ServiceNow","mac_address":"11:22:33:44:55:66","name":"eth0"},"internal_id":"84de302bb5010110b67cda390d8e3047","sys_object_source_info":{"source_name":"ServiceNow"},"settings":{},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}] - [Rule id:38827e660f369200a52afa6ce1050ef5|cmdb_ci_network_adapter|[mac_address, name]] NO_MATCH
identification_engine                 : getDependentCI: checking record 0 with rule mac_address,name
identification_engine                 : createOrUpdateCI: Matched 2 records and 1 relations in 68msec
identification_engine                 : Commit: INSERT cmdb_ci_network_adapter : ccde302b2f010110336f837cf699b64a
service_mapping                       : Invalidating layer de92fa519f030200fe2ab0aec32e7010
service_mapping.recomputation         : Queue recomputation for layer Matching:de92fa519f030200fe2ab0aec32e7010 on environment 5a92fa519f030200fe2ab0aec32e7010
service_mapping.recomputation         : Recomputation Requested for environment 5a92fa519f030200fe2ab0aec32e7010
service_mapping                       : Layer invalidation taking too long (191msec), moving it to background job
identification_engine                 : Commit: INSERT cmdb_rel_ci : 80de302b2f010110336f837cf699b64d
identification_engine                 : Commit: UPDATE cmdb_ci_win_server : e28b05a09f030200fe2ab0aec32e70bc
identification_engine                 : Processed 2 records and 1 relations in 68msec + 1,051msec (waited 8msec for mutex)
identification_engine                 : logId:[90de34abec010110bb9d230964002876] Processed payload from ServiceNow. Using options: {partial_payloads:false,partial_commits:false,deduplicate_payloads:false,generate_summary:false}
identification_engine                 : logId:[90de34abec010110bb9d230964002876] Input = {"items":[{"className":"cmdb_ci_network_adapter","values":{"mac_address":"11:22:33:44:55:66","name":"eth0"},"sys_object_source_info":{"source_name":"ServiceNow"},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}},{"className":"cmdb_ci_win_server","values":{"name":"V-W2K3-32-Web02"},"sys_object_source_info":{"source_name":"ServiceNow"},"sys_ire_info":{"ire_received_time":"2022-01-20 14:19:02"}}],"relations":[{"parent":1,"child":0,"type":"Owns::Owned by","sys_rel_source_info":{"source_feed":"UNKNOWN","source_name":"ServiceNow"}}]}
identification_engine                 : logId:[90de34abec010110bb9d230964002876] Output = {"items":[{"className":"cmdb_ci_network_adapter","operation":"INSERT","sysId":"ccde302b2f010110336f837cf699b64a","identifierEntrySysId":"Unknown","identificationAttempts":[{"info":"sys_object_source SKIPPED","identifierName":"","attemptResult":"SKIPPED","attributes":[],"hybridEntryCiAttributes":[]},{"identifierName":"Network Adapter","attemptResult":"NO_MATCH","attributes":["mac_address","name"],"searchOnTable":"cmdb_ci_network_adapter","hybridEntryCiAttributes":[]}],"info":[],"errorCount":0,"markers":[],"inputIndices":[0],"warningCount":0,"mergedPayloadIds":[]},{"className":"cmdb_ci_win_server","operation":"UPDATE","sysId":"e28b05a09f030200fe2ab0aec32e70bc","identifierEntrySysId":"556eb250c3400200d8d4bea192d3ae92","identificationAttempts":[{"info":"sys_object_source SKIPPED","identifierName":"","attemptResult":"SKIPPED","attributes":[],"hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"SKIPPED","attributes":["serial_number","serial_number_type"],"searchOnTable":"cmdb_serial_number","hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"SKIPPED","attributes":["serial_number"],"searchOnTable":"cmdb_ci_hardware","hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"MATCHED","attributes":["name"],"searchOnTable":"cmdb_ci_hardware","hybridEntryCiAttributes":[]}],"info":[],"errorCount":0,"markers":[],"inputIndices":[1],"warningCount":0,"mergedPayloadIds":[]}],"additionalCommittedItems":[],"relations":[{"className":"cmdb_rel_ci","operation":"INSERT","sysId":"80de302b2f010110336f837cf699b64d","identifierEntrySysId":"Unknown","errorCount":0,"markers":[],"inputIndices":[0],"warningCount":0,"mergedPayloadIds":[]}],"additionalCommittedRelations":[]}
identification_engine                 : Identification Engine Total execution time 1,480msec
*** Script: {"items":[{"className":"cmdb_ci_network_adapter","operation":"INSERT","sysId":"ccde302b2f010110336f837cf699b64a","identifierEntrySysId":"Unknown","identificationAttempts":[{"info":"sys_object_source SKIPPED","identifierName":"","attemptResult":"SKIPPED","attributes":[],"hybridEntryCiAttributes":[]},{"identifierName":"Network Adapter","attemptResult":"NO_MATCH","attributes":["mac_address","name"],"searchOnTable":"cmdb_ci_network_adapter","hybridEntryCiAttributes":[]}],"info":[],"errorCount":0,"markers":[],"inputIndices":[0],"warningCount":0,"mergedPayloadIds":[]},{"className":"cmdb_ci_win_server","operation":"UPDATE","sysId":"e28b05a09f030200fe2ab0aec32e70bc","identifierEntrySysId":"556eb250c3400200d8d4bea192d3ae92","identificationAttempts":[{"info":"sys_object_source SKIPPED","identifierName":"","attemptResult":"SKIPPED","attributes":[],"hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"SKIPPED","attributes":["serial_number","serial_number_type"],"searchOnTable":"cmdb_serial_number","hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"SKIPPED","attributes":["serial_number"],"searchOnTable":"cmdb_ci_hardware","hybridEntryCiAttributes":[]},{"identifierName":"Hardware Rule","attemptResult":"MATCHED","attributes":["name"],"searchOnTable":"cmdb_ci_hardware","hybridEntryCiAttributes":[]}],"info":[],"errorCount":0,"markers":[],"inputIndices":[1],"warningCount":0,"mergedPayloadIds":[]}],"additionalCommittedItems":[],"relations":[{"className":"cmdb_rel_ci","operation":"INSERT","sysId":"80de302b2f010110336f837cf699b64d","identifierEntrySysId":"Unknown","errorCount":0,"markers":[],"inputIndices":[0],"warningCount":0,"mergedPayloadIds":[]}],"additionalCommittedRelations":[],"hasError":false,"hasWarning":false}

 

For instance around line 34 my input payload doesn't match to that existing network adapter.

 - [Rule id:38827e660f369200a52afa6ce1050ef5|cmdb_ci_network_adapter|[mac_address, name]] NO_MATCH'  

And a little further down it shows 

find_real_file.png

And finally looking at the ntwork adapters now a new record was created.  I'm just not clear on the why and digging through the debugging logs I don't see / understand the why.

find_real_file.png

Thanks again for your time and feedback!

Sandeep90
ServiceNow Employee
ServiceNow Employee

There might be a  look-up rule missing on the cmdb_ci_hardware class which is causing this issue.

find_real_file.png

Unfortunately not....

find_real_file.png