Scom 2012 error in UNIX/Linux Computers: An item with the same key has already been added


After I install some UNIX servers, I found the next error when I access to “UNIX/Linux Computers” in the Administration panel:


An item with the same key has already been added

Date: 9/6/201X 19:46:08 PM
Application: Operations Manager
Application Version: 7.0.9538.0
Severity: Error

System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.MonitoringObjectPathToMonitoringObjectDictionary..ctor(IEnumerable`1 monitoringObjects)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.UnixComputerOperatingSystemHelper.JoinCollections(IEnumerable`1 managementServers, IEnumerable`1 resourcePools, IEnumerable`1 unixcomputers, IEnumerable`1 operatingSystems)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.Administration.UnixAgentQuery.DoQuery(String criteria)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.DoQuery(String criteria, Nullable`1 lastModified)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.FullUpdateQuery(CacheSession session, IndexTable& indexTable, Boolean forceUpdate, DateTime queryTime)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalSyncQuery(CacheSession session, IndexTable indexTable, UpdateReason reason, UpdateType updateType)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalQuery(CacheSession session, UpdateReason reason)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.TryDoQuery(UpdateReason reason, CacheSession session)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)




During the discovery of one linux server, the first discovery was unsuccessfully because there was not a dns entry for this server. After solving this problem, I launched the discovery process again and the agent was correctly installed and configured. The day after I discover this problem in the operations console.


  1. Execute in the operations manager DB the next query to obtain all UNIX agents:

DECLARE @NeededTypeName NVARCHAR(256) 
DECLARE @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived UNIQUEIDENTIFIER 
SET @NeededTypeName = N'Microsoft.Unix.OperatingSystem' -- Enter the Class on which we are looking for duplicate entries 
SET @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived = ( 
SELECT ManagedTypeId 
FROM ManagedType 
WHERE TypeName = @NeededTypeName 
NULL AS SourceEntityId 
FROM dbo.ManagedEntityGenericView 
SELECT DISTINCT [BaseManagedEntityId] 
FROM dbo.[TypedManagedEntity] TME WITH(NOLOCK) 
JOIN [dbo].[DerivedManagedTypes] DT 
ON DT.[DerivedTypeId] = TME.[ManagedTypeId] 
DT.[BaseTypeId] = @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived AND 
TME.IsDeleted = 0 
) AS ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived 
ON ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived.[BaseManagedEntityId] = [Id] 
[IsDeleted] = 0 AND 
[TypedMonitoringObjectIsDeleted] = 0 AND 
[ManagedEntityGenericView].[Path] IN ( 
SELECT [BaseManagedEntity].[Path] 
FROM [BaseManagedEntity] 
GROUP BY [BaseManagedEntity].[Path] 
HAVING COUNT([BaseManagedEntity].[Path]) > 1 
ORDER BY [ManagedEntityGenericView].[Path]

2. Export all entries in the “path” column and search duplicate elements using for example excel or notepad ++.

3. If you can access to “Unix/Linux Computers” delete the duplicated objects in the Scom console and rediscover the Server afterwards. This should fix the issue.

What’s happens if you don’t have any element in your “Unix/Linux Computers” in the operation console? you must delete it through Powershell with this command line:



2 Responses to Scom 2012 error in UNIX/Linux Computers: An item with the same key has already been added

  1. aguerrero says:

    Gracias máquina. Me has ayudado a solventar el problema 😉

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: