5 Replies Latest reply on Mar 13, 2017 1:01 PM by tdanner

    No entry for imports generated in DiscoveryLogs when using Invoke/Orion.Discovery/ImportDiscoveryResults

    equalswql

      Hello Thwack Community,

       

      Before you read on, my apologies for the extremely long title for this post.

       

      I'm quite happy to say that I have finally successfully set up automation to run discoveries/imports using REST exclusively with the following verbs:

       

      Invoke/Orion.Discovery/CreateCorePluginConfiguration

      Invoke/Orion.NPM.Interfaces/CreateInterfacesPluginConfiguration

       

      and then building/running discovery via :

      Invoke/Orion.Discovery/StartDiscovery

       

      In the config of Invoke/Orion.Discovery/StartDiscovery - I have set "IsAutoImport" to "False" -

      I'm doing some provisioning of imported items (removal of key nodes/interfaces/volumes) prior to importing discovery results.

       

      At that point, I capture the NodeIDs (for Example 1-10) from the "DiscoveredNodes" table (using SQL or SWIS) matching my ProfileID.

       

      I then run the import using:

      Invoke/Orion.Discovery/ImportDiscoveryResults

       

      The issue, however, is that after running the import, I don't see an entry for the import in the  "DiscoveryLogs" table (using SQL or SWIS).

      I know that I should have an entry for that import, along with an appropriate BatchID as when this is done manually through the UI, an entry is generated.

      This allows me to do a table join via BatchID on the "DiscoveryLogItems"(joining with DiscoveryLogs)  table in order to capture the actual NodeID values for the nodes being imported, as well as track progress of the import.

      Is there a property I need to set in order for this to get generated, or some other verb that needs to be called to have the Import job show up in the DiscoveryLogs table?

      Any help with this would greatly be appreciated.

       

      Thank you,

       

      =SWQL

        • Re: No entry for imports generated in DiscoveryLogs when using Invoke/Orion.Discovery/ImportDiscoveryResults
          tdanner

          After tracing through enough of the code, I can confirm that this is a bug (entered as CORE-7540). The code path behind the "ImportDiscoveryResults" verb does not include adding the record in DiscoveryLogs for no reason I can discern. It does populate DiscoveryLogItems, but it doesn't look like you would have any way to know what the correct BatchID for the join would be.

           

          Your options as I see them:

           

          * Set IsAutoImport=False and add code to delete the unwanted nodes, interfaces, and volumes after the discovery is imported instead of before.

          * Watch the DiscoveryLogItems entity for when new items appear. This will tell you what the BatchID is as long as there are no other discoveries running at the same time and confusing things.

          * Wait for a fix. I don't have a timeframe for that.

          1 of 1 people found this helpful
            • Re: No entry for imports generated in DiscoveryLogs when using Invoke/Orion.Discovery/ImportDiscoveryResults
              equalswql

              tdanner - Thank you for the update, I'm glad you were able to confirm this as I can continue with developing automation further. Plus it's fun finding bugs (well..these kind of bugs I mean..) If this results in any improvement to the API I'm just grateful to be part of contributing to the community which has helped me so often...

               

              In response to your comments:

               

              * Set IsAutoImport=False and add code to delete the unwanted nodes, interfaces, and volumes after the discovery is imported instead of before.

              Even without the batchID, I do get the ProfileID of the discovery - which I can use to delete unwanted nodes/interfaces/volumes, and then run the import - which guarantees I'm getting only what I want. I believe what you are suggesting is to set IsAutoImport to True? so that I get the correlation of the BatchID as importing with the discovery - then doing cleanup afterwards. I believe this would work I'd just have to adjust code.

               

              Other than that, nodes/interfaces/volumes ( in the DiscoveredNodes/DiscoveredInterfaces/DiscoveredVolumes tables - SQL, for some reason DiscoveredInterfaces isn't available in SWIS although present in SQL) automatically get deleted when the import is run and completes successfully. Currently I'm using code to delete entries from both the DiscoveryLogs and DiscoveryLogItems tables as well once import has finished  (I believe this may already be done daily anyhow, but I want to speed up the process)

               

              * Watch the DiscoveryLogItems entity for when new items appear. This will tell you what the BatchID is as long as there are no other discoveries running at the same time and confusing things.

              This was how I was going to work around the issue - only downside being that I can only run one job at a time as you mentioned. When the bug gets fixed, I can have automation run several imports at once. Haven't done any stress testing yet to see just how much I can run at once without issues ... SWIS is pretty robust, but I've still been looking for a method to track utilization of the information service...

              * Wait for a fix. I don't have a timeframe for that.

              I'll wait. And while I'm waiting, I'll work around it. The API is still very very generous in terms of providing the resources to build out automation. I'm grateful for that... it's really useful and the possibilities are still there even with the bug.

               

              Thank you again,

               

              =SWQL

              • Re: No entry for imports generated in DiscoveryLogs when using Invoke/Orion.Discovery/ImportDiscoveryResults
                equalswql

                Hello tdanner,

                 

                Any chance that the CORE-7540 bug will be fixed in 12.1? Also wondering if there are any limitations you know of on doing multiple discoveries at the same time?

                 

                Thank you,

                 

                =SWQL