search cancel

[OSG000202] "Another computer with same MAC address is already defined"

book

Article ID: 132981

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Software Delivery

Issue/Introduction

While trying to pre-register a machine in the DSM Explorer you receive an error:

[OSG000202] "Another computer with same MAC address is already defined"

Cause

This could have multiple causes :

  • A machine had hardware change : Network Interface card, motherboard. And a new MAC address is used.
  • Machine has 2 Network interface. It was installed with OSIM using one network address and use a second address later for communication with its scalability server.

Environment

Client Automation - All Versions

Resolution

1- Execute these 2 SQL Queries with Microsoft SQL Server Management Studio.
 
SELECT o.name 'Computer Name',h.primary_mac_address 'Primary MAC Address',
p2.value 'MAC Address in Boot Configuration',
dateadd ( ss, a.creation_date + datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) 'Creation Date',
dateadd ( ss, a.last_run_date + datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) 'Last Execution Date',
b.name 'Boot Configuration'
FROM csm_object o
INNER JOIN ca_discovered_hardware h ON  o.uuid=h.dis_hw_uuid
INNER JOIN csm_link l1 ON l1.parent=o.id
INNER JOIN csm_object b ON l1.child=b.id 
INNER JOIN csm_link l2 ON b.id=l2.parent
INNER JOIN csm_object mac ON l2.child=mac.id
INNER JOIN csm_property p2 ON p2.object=mac.id
INNER JOIN ca_agent a ON a.object_uuid=h.dis_hw_uuid
WHERE o.class=102 and b.class=1004 and mac.class=106 and mac.name='macaddress' and p2.name='value'
and p2.value COLLATE SQL_Latin1_General_CP1_CI_AS<>h.primary_mac_address COLLATE SQL_Latin1_General_CP1_CI_AS
ORDER BY 1


SELECT o.name 'Computer Name',h.primary_mac_address 'Primary MAC Address',
p.value 'MAC Address in CSM Computer Property',
dateadd ( ss, a.creation_date + datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) 'Creation Date',
dateadd ( ss, a.last_run_date + datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) 'Last Execution Date'
FROM csm_object o
INNER JOIN ca_discovered_hardware h ON o.uuid=h.dis_hw_uuid
INNER JOIN csm_property p ON p.object=o.id
INNER JOIN ca_agent a ON a.object_uuid=h.dis_hw_uuid
WHERE o.class=102 and (p.name='macaddr' OR p.name='macaddrpxe') and p.value COLLATE SQL_Latin1_General_CP1_CI_AS<>h.primary_mac_address COLLATE SQL_Latin1_General_CP1_CI_AS and h.primary_mac_address<>'N/A'
ORDER BY 1


2- If one of these queries returns some rows, execute this to remove the data inconsistency :
use mdb
DECLARE @BACKUP_TABLE AS VARCHAR(64)
SET @BACKUP_TABLE='csm_property_backup_'+REPLACE(CONVERT(varchar, getdate(), 23),'-','_')
IF OBJECT_ID (@BACKUP_TABLE, 'U') IS NULL EXEC('SELECT * INTO '[email protected]_TABLE+' FROM csm_property')
IF OBJECT_ID ('tempdb..#TMP_MAC', 'U') IS NOT NULL DROP TABLE #TMP_MAC 

SELECT h.primary_mac_address, p2.id
INTO #TMP_MAC
FROM csm_object o
INNER JOIN ca_discovered_hardware h ON  o.uuid=h.dis_hw_uuid
INNER JOIN csm_link l1 ON l1.parent=o.id
INNER JOIN csm_object b ON l1.child=b.id 
INNER JOIN csm_link l2 ON b.id=l2.parent
INNER JOIN csm_object mac ON l2.child=mac.id
INNER JOIN csm_property p2 ON p2.object=mac.id
WHERE o.class=102 and b.class=1004 and mac.class=106 and mac.name='macaddress' and p2.name='value'
and p2.value COLLATE SQL_Latin1_General_CP1_CI_AS<>h.primary_mac_address COLLATE SQL_Latin1_General_CP1_CI_AS
UNION
SELECT h.primary_mac_address, p.id
FROM csm_object o
INNER JOIN ca_discovered_hardware h ON o.uuid=h.dis_hw_uuid
INNER JOIN csm_property p ON p.object=o.id
WHERE o.class=102 and (p.name='macaddr' OR p.name='macaddrpxe') and p.value COLLATE SQL_Latin1_General_CP1_CI_AS<>h.primary_mac_address COLLATE SQL_Latin1_General_CP1_CI_AS and h.primary_mac_address<>'N/A'
ORDER BY 1

UPDATE csm_property SET value=#TMP_MAC.primary_mac_address FROM #TMP_MAC WHERE #TMP_MAC.id=csm_property.id