BCM How to Find the Device with same GUID duplication and to remediate

Version 1
    Share:|

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    BMC Client Management


    COMPONENT:

    Client Management


    APPLIES TO:

    Any version of BCM



    QUESTION:

    How to Find the Devices with same GUID in case of device name got changed using sql query.


    ANSWER:

    Run the following queries against your database. Note that you might need to edit them to reflect the owner of your database first. Thee queries will list every device that is identified as a duplicate by the master. Every device guid that appears in the results of these queries will have to be blacklisted in the system variables.

    - Run the following query that relates to the type of database your master uses:

       
    • Shared MS sql Query to find the duplicate GUID and duplicate devices:
      
       
    SELECT d.DeviceID
       
    ,d.DeviceName as Current_Name
       
    ,substring (description,2,charindex('}',description)-2) as Prior_Name
       
    ,d.GloballyUniqueID
       
    ,min(elog.IntegrationDate) as min_eventdate
       
    ,max(elog.IntegrationDate) as max_eventdate
       
    ,COUNT(eventlogid) as NumberOfChanges 
       
    from bcmdbuser.EvLog_ObjType_710 elog
       
    join bcmdbuser.Devices d on d.DeviceID=elog.DeviceID
       
    where EventType='_DB_EVENTTYPE_DEVICENAME_CHANGE_ENUM_'
       
    and d.DeviceName <> substring (description,2,charindex('}',description)-2)
       
    and d.TopologyType in ('_DB_DEVTYPE_CLIENT_','_DB_DEVTYPE_MASTER_','_DB_DEVTYPE_RELAY_')
       
    group by d.deviceid
       
    ,d.DeviceName
       
    ,d.TopologyType
       
    ,d.GloballyUniqueID
       
    ,substring (description,2,charindex('}',description)-2)
       
    having count(elog.eventlogid) > 1
       
    order by numberofchanges desc;
     

    For ORACLE:

     select d.DeviceID
     ,elog.eventdate as Event_log_date
     ,d.devicename As Current_Name
     ,substr(elog.description,2,instr(elog.description,'}')-2) as Prior_Name
    ,elog.description as Event_log_entry
    from EvLog_ObjType_710 elog

    join Devices d on d.DeviceID=elog.DeviceID
    where elog.EventType='_DB_EVENTTYPE_DEVICENAME_CHANGE_ENUM_'
      and d.TopologyType in ('_DB_DEVTYPE_CLIENT_','_DB_DEVTYPE_MASTER_','_DB_DEVTYPE_RELAY_')
      and elog.deviceid in
        (
          select d2.DeviceID
          from EvLog_ObjType_710 elog2
          join Devices d2 on d2.DeviceID=elog2.DeviceID
          where elog2.EventType='_DB_EVENTTYPE_DEVICENAME_CHANGE_ENUM_'
            and d2.DeviceName <> substr(elog2.description,2,instr(elog2.description,'}')-2)
          group by d2.deviceid
          Having Count(elog2.eventlogid)>2
        )
    order by d.deviceid, eventdate desc;

     

    For PostgresSQL:

     

        
    select d.DeviceID,
       
      COUNT(eventlogid) as "#_Name_Changes",
       
      d.devicename As Current_Name,
       
      substring(description from 2 for position('}' in description)-2) as Prior_Name,
       
      d.netbiosname as Current_NetbiosName
       
    from EvLog_ObjType_710 elog
       
    join Devices d on d.DeviceID=elog.DeviceID
       
    where EventType='_DB_EVENTTYPE_DEVICENAME_CHANGE_ENUM_'
       
    and lower(DeviceName) <> lower(substring(description from 2 for position('}' in description)-2))
       
    group by d.deviceid ,d.devicename, d.netbiosname, Prior_Name
       
    having count(eventlogid) > 2
       
    order by d.deviceid,"#_Name_Changes" desc
       
     
      
      
      This query will return output like:  
      DeviceID    Current_Name    Prior_Name    GloballyUniqueID    min_eventdate    max_eventdate    NumberOfChanges 
        

    - Create a list of the Globally unique ids you will find in the results of this query. Separate every GUID by a ","
    - Go to Global Settings > System Variables > Connection Management in the console and set this list into the field "List of Banned GUIDs"

    Now you need to understand why you got it this situation:
    - devices are not set with their final name before the BCM agent starts for the first time on the device?
    - you deploy an image to install a device, and this device contains a BCM agent at already has an agent installed. This agent was started before the capture and it has a GUID in its identity.ini
    - All your devices have the same name/hardware
    If any of these two is confirmed then you'll need to change your process.

       
     
     
      

     


    Article Number:

    000139798


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles