How to find direct parent of a CI?

jaysumara99
Giga Contributor

I am new to SNC, and trying to figure out the CDM so that I can import the SNC CMDB into external database. I have imported all the CIs, CITypes, Properties and relations. However the problem I have is figuring out the direct parent of a CI as opposed to a parent defined with parent-child relationship.

For example, a Computer is direct parent of a Network Card Or a Disk Drive on itself. So we can call a Network Card or a Disk as a "component" of a Computer. Then there can be a DB2Instance running on it, which say is related as "dependent child" of a Computer with relationship definition, however its not a "Component" of a Computer.

So the question I have is, if there is a CI "A" in SNC cmdb_ci table, how to figure out which CIs from rest of the CIs are the "Components"and which ones are "dependent children" of "A"?

Please help.

1 ACCEPTED SOLUTION

I am not aware of a document showing all the mappings for the CI types.   From the Tables & Columns module within Service Now you can select a specific table and click the Schema Map button that will show you a graphical view of the table and its relationships to other tables.   I know that isn't exactly what you are looking for, but it may help with some of the questions.   Other than the software tables changing with the newer software asset management plugin (which has been around since, at least, the Calgary release) I'm not aware of any other CMDB tables that are no longer used, but I'm not a CMDB expert by any stretch of the imagination.   My experience has been mostly from importing information from other sources into Service Now and our information is far from complete.   I always want what is in the CMDB to be accurate so we have been careful with what we are import, but I know we don't use it to its fullest potential.



-Steve


View solution in original post

9 REPLIES 9

Steve McCarty
Mega Guru

Generally for a "component" type relationship there is a field on the child table that points directly to the related CI.   For instance, on the Disk Drive table there is a field called Computer that points to a computer type CI and on the Network Adapter table there is a Configuration Item field that points to a parent CI of any type.  



For the "dependent children" there is a separate CI Relationship table that defines which CI is a parent and which is a child, as well as the type of relationship between the two.   This can be a many to many relationship so there has to be a separate table to make the connections.   So to find which server a DB2Instance is running on you will need to query the CI Relationship table and look for that instance in the child field and then find the server listed in the parent field.



Hopefully that helps.



-Steve


Great, now the second part of your answer where the relationship is clearly defined in the relationships table, is clear. Thanks.



The problem is with the first part, the direct component. As you said the "cmdb_ci_disk" does have a column "computer" which refers to record in "cmdb_ci_computer", so that does say that the disk a component to computer. However some of the CI Types have multiple such columns. For example "cmdb_ci_msd" has two such references (attached_to and dr_backup, and both of them are computer type). We cant have multiple direct parents, so which one of these is the parent? Also many CI types which are supposed to have a direct parent, do not have any column that refers to another CI. For example, cmdb_ci_spkg should be having a reference to a computer on which that software package is installed. Or Network Card should have a column refering to the computer on this that card is installed. So in such case, how do I find a computer to which software package is a component?


srinivasthelu
Tera Guru

Hi Jay,



Just to add, Computer table related list will give you an idea, what field is driving the relation. In the screen below the Computer relationship with TCP connection   is derived through computer field on the TCP Connection table. If you look at the filter(in Blue) that will indicate the relationship.




Screen Shot 2016-02-13 at 11.30.16 PM.png




Hope that helps



Please mark this response as helpful/correct if it does so



Srini


Srinivas,


I think Stephen did clear this part where a relationship is defined with a relathipship entry. What I am looking for is a direct "component" CIs such as a disk, or software, or a Windows Service directly installed on a computer AND NOT in a relationship table. How to find a parent, without looking at a relationship table?



Regards,


Jay