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

Version 2
    Share This:

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


    BMC Client Management


    Client Management


    Any version of BCM


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


    Run the following queries against your database. Note that you might need to edit them to reflect the owner of your database first. These 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.

    Warning: these queries will list all duplicate GUID issues from the table. This table might have a lot of history and you might find GUID issues that have actually been solved since then (check the settings in Gloval Settings > System Variables > Event management. This is why you might want to edit it to add a date to not to look after.

    - 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
    ,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
    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
    ,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
      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
    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:


    Article Type:


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