How can we report on cmdb_items that have no relationship to other cmdb_items?

veerlerutten
Kilo Explorer

How can we report on cmdb_items that have no relationship to other cmdb_items?

12 REPLIES 12

mechamberlain
Mega Expert

You will need to create a database view [which is very easy] to report against since the CI's and the relationships are held in different underlying tables.  



Create a database View:


http://wiki.servicenow.com/index.php?title=Database_Views#gsc.tab=0



I hope this helps!



Marty


Community Alums
Not applicable

Hi Veerle,



To do this, you will need a Database View that links the Configuration Items (cmdb_ci or a table that extends it if you wanted to be more specific and just report on something like Servers with no relationships) and the CI Relationship (cmdb_rel_ci) table. Set this up with a left join as described in the blog post How Do You Report on Nothing? and you should be able to find what you want. Once you have the list, you can define some filters so you don't include items (such as end user computers if you have CIs for them) that you do not want to include).



Here is how I configured the Database View:


Screen Shot 2015-11-23 at 8.08.05 AM.JPG


Some important points here:


  • Order is important
  • You will need to add the Left join colum to the list to adjust the value to true
  • The full Where clause is: rel_parent = ci_sys_id || rel_child = ci_sys_id. This matches where the CI is a child or a parent in the relationship.


When you click Try it, you can update the columns that display and apply a filter to get the information you are looking for. This is what I did:


Screen Shot 2015-11-23 at 8.07.10 AM.JPG


It becomes a simple list with three fields, and I filtered so it displayed items only when the child and parent were both blank.



Hope this helps.



Ben


Hi Ben, when I try to run this DB view the browser window hangs and just shows a blank page. Any idea why this is happening?


Community Alums
Not applicable

Suhas,



Can you please share a screenshot of your DB View configuration and the screen where you are trying to load it?


We need to determine if there is just no data that matches your configuration or if your configuration is causing an issue that is preventing the load.



Thanks,


Ben