Free ebook: Introducing Microsoft System Center 2012 R2

In Microsoft Press Blog: http://blogs.msdn.com/b/microsoft_press/archive/2013/12/16/free-ebook-introducing-microsoft-system-center-2012-r2.aspx?loc=zTS1z&prod=zSCz&tech=zOttechz&prog=zPressz&type=zDLz&media=zOTmediaz&country=zUSz

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/

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

Powershell: create Windows event log

Create a NT eventlog for testing event monitor or rules:

Write-Eventlog -Logname ‘Application’ -Source ‘Hyperion EPMA DimensionServer’ -EventID 0 -EntryType Error -Message “This is a test of Gustavo Mendez (SCOM)”

 


 

More informationhttp://technet.microsoft.com/en-us/library/hh849847.aspx

To write an event to an event log, the event log must exist on the computer and the source must be registered for the event log.

The cmdlets that contain the EventLog noun (the EventLog cmdlets) work only on classic event logs. To get events from logs that use the Windows Event Log technology in Windows Vista and later versions of Windows, use Get-WinEvent.


 

First steps in Visual Studio Authoring Extensions

  1. MVP Pro Speaker Series:Tips & Tricks to Using the Visual Studio Authoring Extensions: http://blogs.technet.com/b/wincat/archive/2013/05/01/mvp-pro-speakers-series-tips-amp-tricks-to-using-the-visual-studio-authoring-extensions-level-300.aspx
  2. First steps in Visual Studio Authoring Extensions for System Center 2012 – Operations Manager: http://social.technet.microsoft.com/wiki/contents/articles/5236.visual-studio-authoring-extensions-for-system-center-2012-operations-manager.aspx
  3. Visio Management Pack Designer for System Center 2012 – Operations Manager (with exercises): http://social.technet.microsoft.com/wiki/contents/articles/5235.visio-management-pack-designer-for-system-center-2012-operations-manager.aspx.

Next the exercises to download:

Operations Manager Management Pack Examples – Health Model: http://gallery.technet.microsoft.com/Operations-Manager-9185d978

Operations Manager Management Pack Examples – Service Model: http://gallery.technet.microsoft.com/Operations-Manager-0bdbdac7