The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Duplicate CI(s) relationships in CMDB

Sergei3
Kilo Contributor

Hello,

I am dealing with the issue where existing CIs duplicate relationships are causing the SN Discovery to fail to update a scanned CI.

Does anyone happen to know how to query CMDB CI relationships table (cmdb_rel_ci) and produce a report to list all duplicate CI relationships?

Thank you!

4 REPLIES 4

Frank Tate
Mega Guru
Mega Guru

Here's a previous post similar to yours. The script that answers your question (reply from @jochen.larbig ) is far down the replies, so I'm including it here:

var gaDupCheck = new GlideAggregate('cmdb_rel_ci');
gaDupCheck.groupBy('parent');
gaDupCheck.groupBy('child');
gaDupCheck.groupBy('type');
gaDupCheck.addHaving('COUNT', '>', 1);

Frank

Sergei3
Kilo Contributor

Thank you Frank for the prompt response!

Do you happen to know, which group/role can work with GlideAggregate/create the scripts?

Is it CMDB Admin team?

Thank you!

The CMDB Admin team probably has authority to create scripts, or they will know who in your organization does have that authority.

Frank

mikkojuola
Mega Guru

Hi Sergei,

This question inspired me to write a short blog post on "how to find duplicate CI relationships without scripting". You can find the post here: https://datacontentmanager.com/best-way-to-find-duplicate-ci-relationships

If you want to know more or give it a try yourself, you can reach out to me via the same link.

Cheers,

--Mikko