SCOM 2012: resolve automatically alerts “Agent proxy not enabled”

An easy solution for resolve automatically the uncomfortable alerts “Agent proxy not enabled”:

http://scug.be/dieter/2013/05/10/scom-automatically-enable-agentproxying/

Advertisements

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

Summary

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

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)


 

 

Causes:

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.

Resolutions:

  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 
) 
SELECT 
[ManagedEntityGenericView].[Id], 
[ManagedEntityGenericView].[Name], 
[ManagedEntityGenericView].[Path], 
[ManagedEntityGenericView].[FullName], 
[ManagedEntityGenericView].[LastModified], 
[ManagedEntityGenericView].[TypedManagedEntityId], 
NULL AS SourceEntityId 
FROM dbo.ManagedEntityGenericView 
INNER JOIN ( 
SELECT DISTINCT [BaseManagedEntityId] 
FROM dbo.[TypedManagedEntity] TME WITH(NOLOCK) 
JOIN [dbo].[DerivedManagedTypes] DT 
ON DT.[DerivedTypeId] = TME.[ManagedTypeId] 
WHERE 
DT.[BaseTypeId] = @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived AND 
TME.IsDeleted = 0 
) AS ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived 
ON ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived.[BaseManagedEntityId] = [Id] 
WHERE 
[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:

Get-SCXAgent UNIXSERVER.DOMAIN.LOCAL | Remove-SCXAgent