locked
An item with the same key has already been added RRS feed

  • Question

  • Hello All, Thanks! in advance.

    Yesterday i applied UR1 to the SCOM2019 environment. After the apply of the UR1 We are seeing the below mentioned error while opening the UNIX/Linux computers view in Device Management in Administration tab.

    Date: 4/24/2020 4:08:16 AM
    Application: Operations Manager
    Application Version: 10.19.10050.0
    Severity: Error
    Message: 

    System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       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.UnixComputerOperatingSystemHelper.GetUnixComputerOperatingSystemInstances(String criteria)
       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)

    Thanks! Anu_SCORCH


    Friday, April 24, 2020 9:16 AM

Answers

  • As the new Linux/UNIX management pack is now version agnostic, you'll have to disable the discovery of the "Universal Linux (RPM) Computer", if you don't want to disable the RHEL 6 management pack discovery.

    Disabling the other discovery will then again affect discovering newer RHEL operating systems in the future, so you should really start planning on upgrading your RHEL 6 servers.



    Blog: https://thesystemcenterblog.com LinkedIn:

    • Marked as answer by ANU_SCORCH Friday, April 24, 2020 12:41 PM
    Friday, April 24, 2020 11:48 AM
  • I don't entirely agree : if you have custom monitors targeted specifically at RedHat 6 disks, you can't remove the RHEL6 MP like that. You won't be able to remove the MP if another MP depends on it, so you'll have to remove the custom MP as well.

    And if you still need that custom monitoring, you'll have to rewrite the custom MP to make it work with the new Universal MP.


    • Edited by CyrAz Saturday, April 25, 2020 11:36 AM
    • Marked as answer by ANU_SCORCH Monday, April 27, 2020 6:58 PM
    Saturday, April 25, 2020 11:35 AM

All replies

  • Hi,

    This issue is caused when using the old RHEL management packs to support older RHEL versions, but also using the new Universal (version agnostic) management packs for Linux, so we end up with two computers.

    You'll need to disable the discovery of one or the other, then run Remove-SCOMDisabledClassInstance

    Check the similar post here:
    An item with the same key has already been added when SCOM 2019 upgrade to UR1

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    • Proposed as answer by CyrAz Friday, April 24, 2020 10:05 AM
    Friday, April 24, 2020 9:28 AM
  • You could also simply remove the redhat6 MP, if the monitoring provided by the universal MP is sufficient for your requirement
    Friday, April 24, 2020 10:06 AM
  • Excellent Leon.

    Which exact discovery i need to remove and run the Remove-SCOMDisabledClassInstance.

    We are still having RHEL6 and RHEL7 servers. We are using lot of custom monitors that are explicitly targeted to Red hat Linux 6 OS, Red hat Linux 6 Logical disk versions only. what will happen if i disabled any particular RHEL6 discovery.


    Friday, April 24, 2020 10:45 AM
  • Wonder full CyrAz.

    We are still having RHEL6 servers. We are using lot of custom monitors that are explicitly targeted to Red hat Linux 6 OS, Red hat Lunux 6 Logical disk versions only. I think if i removed RHEL6 MP all the custome monitors associated with RHEL6 OS and RHEL6 Logical disk also get removed.
    Friday, April 24, 2020 10:46 AM
  • You could disable the RHEL 6 computer discoveries from either the RHEL 6 management pack, or from the new Universal Linux management pack, then run the Remove-SCOMDisabledClassInstance which will delete the class instances for which you disabled the discovery.

    Here's another similar thread:
    SCOM 2019 - Universal Linux Monitoring MP - Duplicate Items

    Side note: RHEL 6 is not officially supported by SCOM 2019, however that doesn't mean you won't be able to monitor them.


    Blog: https://thesystemcenterblog.com LinkedIn:

    Friday, April 24, 2020 10:58 AM
  • Hello Leon,

    If am scoping the  object discovery am able to see only the below Object discoveries from universal MP. Could you please help me to find the s RHEL 6 computer discoveries from the new Universal Linux management pack.

    Disabling RHEL 6 version  discovery from RHEL6 MP is not an ideal solution in our case.


    • Edited by ANU_SCORCH Friday, April 24, 2020 11:27 AM correction
    Friday, April 24, 2020 11:20 AM
  • As the new Linux/UNIX management pack is now version agnostic, you'll have to disable the discovery of the "Universal Linux (RPM) Computer", if you don't want to disable the RHEL 6 management pack discovery.

    Disabling the other discovery will then again affect discovering newer RHEL operating systems in the future, so you should really start planning on upgrading your RHEL 6 servers.



    Blog: https://thesystemcenterblog.com LinkedIn:

    • Marked as answer by ANU_SCORCH Friday, April 24, 2020 12:41 PM
    Friday, April 24, 2020 11:48 AM
  • Understood completely Leon.

    Please correct am if am wrong. If am disabling the discovery "Universal Linux (RPM) Computer" and running the Remove-SCOMDisabledClassInstance this will resolve temporary.

    Since we are going to add RHEL8 servers in to our environment in order to discovery RHEL8 servers i need to enable the discovery of Universal Linux (RPM) Computer. this will again start the problem. So the only work around will be deleting the RHEL6 MP and redirect all the custom MP that is already targeted to RHEL6  OS and RHEL6 Logical disk to Universal Linux operating system universal Logical disk.

    Thanks! Leon


    Friday, April 24, 2020 12:28 PM
  • Since you're planning on adding RHEL 8 servers, the better option would be to remove the RHEL 6 management packs.

    Blog: https://thesystemcenterblog.com LinkedIn:

    Friday, April 24, 2020 12:31 PM
  • perfect! thanks for your valuable input.
    Friday, April 24, 2020 12:41 PM
  • I don't entirely agree : if you have custom monitors targeted specifically at RedHat 6 disks, you can't remove the RHEL6 MP like that. You won't be able to remove the MP if another MP depends on it, so you'll have to remove the custom MP as well.

    And if you still need that custom monitoring, you'll have to rewrite the custom MP to make it work with the new Universal MP.


    • Edited by CyrAz Saturday, April 25, 2020 11:36 AM
    • Marked as answer by ANU_SCORCH Monday, April 27, 2020 6:58 PM
    Saturday, April 25, 2020 11:35 AM
  • Absolutely CyrAZ. That was our initial plan Recreate all the custom monitors in Universal os and disk and remove the rhel6 references from the custom mp and delete the rhel6 MP.

    We changed the plan.Now we have created new Group contains all our RHEL 6 servers and disable the discovery " Discover Universal Linux Computer" with new group. So the existing monitoring will work and the duplicate entry will get removed. Bad luck for RHEL6 MP there is no support. Hope we will completely move out from Rhel6 servers very soon.



    • Edited by ANU_SCORCH Monday, April 27, 2020 6:58 PM Correction
    • Marked as answer by ANU_SCORCH Monday, April 27, 2020 6:58 PM
    • Unmarked as answer by ANU_SCORCH Monday, April 27, 2020 6:58 PM
    Monday, April 27, 2020 12:44 PM