How to create DSM Explorer Queries to find Agents with Duplicate Host Names or IP Addresses

Document ID : KB000028829
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

How to create  DSM Explorer Queries to find Agents for the following:

  • Duplicate host names
  • Duplicate IP addresses

 

Environment:  

CA Client Automation - All Versions

Answer: 

Create these Queries in DSM Explorer using Advanced Argument Queries and then create Dynamic Groups based on these Queries.  

Right-click on Queries and select New

Select Computers from the select Target window

Select Advanced Argument from the Query Designer Window:

query1.png

 

1. For Duplicate Host names :

   Pseudo text:                               hostname

   Table:                                          -Any-

   Additional WHERE clause:         

SELECT dis_hw_uuid FROM ca_discovered_hardware WHERE host_name IN (SELECT host_name FROM ca_discovered_hardware AS ca_discovered_hardware_1 GROUP BY domain_uuid, host_name HAVING (COUNT(host_name) > 1))

 (**** The Additional WHERE clause has to be copied in from one line, 2 or more lines will add an EOL character and cause Query to fail ****)

 

2. For Duplicate Host IP Address :

   Pseudo text:                               IPAddress

   Table:                                          -Any-

   Additional WHERE clause:         

SELECT dis_hw_uuid FROM ca_discovered_hardware WHERE dis_hw_uuid IN (SELECT object_uuid FROM ca_agent WHERE ip_address IN ( SELECT  ip_address FROM ca_agent AS ca_agent_1 WHERE agent_type =1  GROUP BY ip_address HAVING (COUNT(ip_address) > 1)))

(**** The Additional WHERE clause has to be copied in from one line, 2 or more lines will add an EOL character and cause Query to fail ****)

 

Then click  OK

Save and name the Query

 

Now you can create Groups, based off those Queries.