Duplicate computer report across multiple datasources

Does anyone have any ideas on how to remove duplicate computers across multiple bigfix environments? All environments feed a single WebReport instance and I have report to identify clients that have more than one occurrence, but because the report goes off of the multiplicity of the name of the bes computers, I don’t think I can pull back computer info (last report time, computer id) in the same query. If WebReports can provide me with the hostname of the most inactive of the duplicates, I can have automation call the output of the report and then make a REST call to the BES root server to remove the duplicate client.

Suggestions?

Hi,

This should be a simple session relevance query. You can use your current query to feed a whose-it to pull the computers and any other properties – then simply identify a common property across your instances that you want to use to furhter identify duplicates (Serial Number, MAC Address, Service Tag, etc) and then utilize a nested session relevance query to identify duplicates.

For example:

.... of bes computers whose (Set of <Query that pulls duplicates> contains name of it)

You can use a scripting language like powershell to reduce the REST queries required to pull this info if you need to.

Are you asking for a sample session relevance query or general information for how others have approached this issue?

Bill

Hi, i’m looking for a help with the session relevancy query.

This is what I have to identify those duplicates, but what I would really like is for the report to only contain the duplicate that is oldest, and that is the one I will delete.

<?Relevance
(name of it, id of it, last report time of it, database name of it) 
of 
items 0 of it whose (name of item 0 of it = item 1 of it) 
of (bes computers, it) 
of (unique values whose (multiplicity of it > 1) of names of bes computers)
?>

Does this work?

 (name of it, id of it, last report time of it, database name of it) 
of unique values of items 0 of it whose (name of item 0 of it = name of item 1 of it and last report time of item 0 of it < last report time of item 1 of it) of (elements of it, elements of it) of (set of items 0 of it whose (name of item 0 of it = item 1 of it) 
of (bes computers, it) 
of (unique values whose (multiplicity of it > 1) of names of bes computers))

(Edited based on changes later in the post)

error: Singular expression refers to non-unique object.

Sorry try it now. I was missing a plural and only testing against one duplicate – and I wasn’t deduplicating the list.

That ran through, but still lists both occurrences of the same hostname. It also took 41seconds to run.

example:
server1, 10901756, ( Thu, 12 Jan 2017 08:20:57 -0600 ), DATASRC1
server1, 12499316, ( Thu, 12 Jan 2017 08:41:19 -0600 ), DATASRC1

Queries like this will be very slow because we are iterating over all the computers in the console more than once.

I think I was missing a name check – try this:

 (name of it, id of it, last report time of it, database name of it) 
of unique values of items 0 of it whose (name of item 0 of it = name of item 1 of it and last report time of item 0 of it < last report time of item 1 of it) of (elements of it, elements of it) of (set of items 0 of it whose (name of item 0 of it = item 1 of it) 
of (bes computers, it) 
of (unique values whose (multiplicity of it > 1) of names of bes computers))

Still seeing some computers names with the same hostname in the results. Any idea way that is still showing up? The webreport instance is pulling from 4 data sources.

Also for the speed issue, any idea of a more efficient way to get this info?

Are you sure those computers don’t have multiple entries in BigFix? I computer with 3 entries in BigFix would show up twice in the report.

Due to the way this query works – the fewer duplicates you have the faster the report will run.

Bill

Ah, you’re right. I was thinking I would only see 1 results but yes, if there are 3 duplicates of 1 host, then I would see more than one, and that is what is happening.

thanks!

How about also only retrieving clients that haven’t reported in with the last 1*day?

We can filter by putting whatever criteria we want after unique values like: whose (Last report time of it < now-1*day)

Here’s what that relevance would look like:

 (name of it, id of it, last report time of it, database name of it) 
of unique values whose (Last report time of it < now-1*day) of items 0 of it whose (name of item 0 of it = name of item 1 of it and last report time of item 0 of it < last report time of item 1 of it) of (elements of it, elements of it) of (set of items 0 of it whose (name of item 0 of it = item 1 of it) 
of (bes computers, it) 
of (unique values whose (multiplicity of it > 1) of names of bes computers))
1 Like

perfect. thanks much!