Duplicated machines not found in DSM Explorer
search cancel

Duplicated machines not found in DSM Explorer

book

Article ID: 280608

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

There are different ways to detect if there are machines duplicated in the environment, one is using the built-in function in WinOffline or running a query like this:

select * from ca_discovered_hardware where dis_hw_uuid not in
(select object_uuid from ca_agent where agent_type =1)

If a machine is shown a duplicated, but can't be found on DSM Explorer, the only way to remove it is using SQL queries.

Environment

Client Automation 14.x

Cause

There are some queries that can be executed to delete those records, as explained here:

Why do I see more agents when I run a Query then I do when I create a Dynamic Group based on that Query ?

But if an error is shown related to ca_link_dis_hw_user table, it means there are links related to those duplicated Agents that have to be deleted first.

Resolution

In order to delete the links in table ca_link_dis_hw_user  for duplicated machines and also the records found in ca_discovered_hardware, the following queries can be executed:

NOTE: It's mandatory to take a FULL backup of the MDB before directly running any DELETE statement.

DELETE ca_link_dis_hw_user
FROM ca_discovered_hardware h
INNER JOIN ca_link_dis_hw_user l ON l.dis_hw_uuid=h.dis_hw_uuid
WHERE h.label like '%XYZ%' and h.dis_hw_uuid not in (SELECT object_uuid FROM ca_agent)

Once the links present in ca_link_dis_hw_user were deleted, the query to delete this particular Agent can be executed:

DELETE FROM ca_discovered_hardware
WHERE label like '%XYZ%' and dis_hw_uuid not in (SELECT object_uuid FROM ca_agent)

"XYZ" is the label (hostname) of the Agent found as duplicated.

Additional Information

If it's needed to see what records will be deleted before doing it, the previous queries can be modified as follow:

SELECT * FROM ca_discovered_hardware h
INNER JOIN ca_link_dis_hw_user l ON l.dis_hw_uuid=h.dis_hw_uuid
WHERE h.label like '%XYZ%' and h.dis_hw_uuid not in (SELECT object_uuid FROM ca_agent)


SELECT * FROM ca_discovered_hardware
WHERE label like '%XYZ%' and dis_hw_uuid not in (SELECT object_uuid FROM ca_agent)