Uncreated CIs After discovery.

Dattatraygh
Tera Contributor

After any discovery gets completed, I want to find out the IPs which are in scope but not created as CI.

As I understand, Scoped IPs will be available in discovery_device_history table. But how can I find that IP has not created any CI?

When I open any record in discovery_device_history table, there is one field named "CMDB CI".

If it has any value, it means it has created a CI and if it is blank it means it has not created any CI.

Please correct me if I am wrong.

 

If I am correct, then I can use this field in my flow to capture the IPs which are not created as CI.

 

Dattatraygh_0-1777533873775.png

 

1 ACCEPTED SOLUTION

Chanuka
Tera Guru

Hi @Dattatraygh ,

 

You're on the right track.

 

The 'discovery_device_history' table is exactly where ServiceNow tracks the outcome for every IP address in your discovery scope.

 

Why this works:

The "CMDB CI" field is a reference to the right CI. During the Discovery, the 'cmdb_ci' field only gets populated if the Identification phase is successful. If the scan stops at Scanning, Classification, or fails Identification, that field will remain as Empty .

 

How to set this up in your Flow:
You can use this field in your flow designer.

 

  1. Use a "Look up Records" action on the 'discovery_device_history' table.
  2. Set the condition: CMDB CI is 'Empty'.
  3. Add a condition for Discovery Status to target a specific discovery run(but this is Optional).

 

To make your report even better, I suggest checking the 'Last State' or 'Completed Activity' fields too. This will tell you why the Configuration item wasn't created.

For example: If it failed at the 'Classification' stage due to credential issues.


Also, if you just need a quick report without need of a flow, just go and check out the Discovery 'Home' dashboard. The "Errors" widget there already tracks devices that were not identified.

 

Have a good day!

Best,
Chanuka

 

If this helped point you in the right direction, please mark it as Helpful or Accept as Solution!

View solution in original post

2 REPLIES 2

Chanuka
Tera Guru

Hi @Dattatraygh ,

 

You're on the right track.

 

The 'discovery_device_history' table is exactly where ServiceNow tracks the outcome for every IP address in your discovery scope.

 

Why this works:

The "CMDB CI" field is a reference to the right CI. During the Discovery, the 'cmdb_ci' field only gets populated if the Identification phase is successful. If the scan stops at Scanning, Classification, or fails Identification, that field will remain as Empty .

 

How to set this up in your Flow:
You can use this field in your flow designer.

 

  1. Use a "Look up Records" action on the 'discovery_device_history' table.
  2. Set the condition: CMDB CI is 'Empty'.
  3. Add a condition for Discovery Status to target a specific discovery run(but this is Optional).

 

To make your report even better, I suggest checking the 'Last State' or 'Completed Activity' fields too. This will tell you why the Configuration item wasn't created.

For example: If it failed at the 'Classification' stage due to credential issues.


Also, if you just need a quick report without need of a flow, just go and check out the Discovery 'Home' dashboard. The "Errors" widget there already tracks devices that were not identified.

 

Have a good day!

Best,
Chanuka

 

If this helped point you in the right direction, please mark it as Helpful or Accept as Solution!

Here, what my requirement is, whenever any discovery gets completed, I want to send email notification to the target group regarding the IPs which are in scope but failed to create as CI.
I have created a flow to send notification.


Trigger - Record Updated where Discovery Status Changes to Completed.

Action - Look up Records

                Table - cmdb_device_history

                Condition - Discovery Status Is Trigger>Record>SysID

                For Each Item in Device Record

                                 If CMDB CI is Empty

                                         Then Set Variable - UncreatedCIs (append the source value to this variable.)

                If UncreatedCIs is not empty

                            Then Send Email