This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Created dependencies dont work using python SDK

I am attempting to create a dependency using the python SDK and when I run the automated script it creates the dependency but it does not make the child unreachable when the parent node is down.

Below I have the example code as well as a screenshot of the GUI showing that the child is down when the parent is down on 2 of my dependencies. Please help, I am creating close to 6800 dependencies in this project so using the GUI is simply not an option.

     depUri = swis.create('Orion.Dependencies',

        Name=name,

        ParentUri=parent['DetailsUrl'],

        ChildUri= child['DetailsUrl'],

        AutoManaged=False,

        IncludeInStatusCalculation=True,

        EngineID=0,

        Category=0,

        ParentEntityType=parent['EntityType'],

        ParentNetObjectID=parent['NodeId'],

        ChildEntityType=child['EntityType'],

        ChildNetObjectID=child['NodeId'],

        Description='Node To Node Dependency')

pastedImage_0.png

I have called solar winds about it and they suggested that I change the engine id but that did not work either.

If anyone has any ideas let me know. I really appreciate the help!

  • I would make sure that the children nodes don't have another parent. My understanding is that from the perspective of SolarWinds objects with multiple parents are treated as having redundant paths. Essentially they are evaluated as an AND not an OR, so the node would only show as unknown if both parent A and parent B were down, not if parent A or parent B were down.

    Note, I have found duplicate dependencies through groups as well, if a node is a member of a group that is a child of something then that node also is a child of that thing.

  • I'm wondering if you ever found a solution for this.  I have the same issue.

    I may have found the problem but don't have a scriptable solution.  When you edit the dependency manually on the 'Review' screen there is a setting 'When the parent goes down:'.  My dependencies are acting as if that is set the wrong way.  I can't be certain of that because I don't see a way to simply look at the settings without editing them.  But I did manually change one of the dependencies to use the correct setting there and it is behaving as expected.

    But I don't see any way to set that with a script.

    I have a case open with Solarwinds support but so far haven't been much help at all.  And if it does turn out to be that setting I'm expecting the answer that 'we don't support the api' and expect me to change them all manually.

    But if you found a solution I'd very much appreciate hearing about it.

  • Update on this:  My problem has nothing to do with the 'When the parent goes down' setting.  I was able to find the swql field that controls that, 'IncludeInStatusCalculation' and was able to verify that the dependencies I had created with the api had the field set correctly.

    So I'm back to having no idea what is causing the issue (and so far neither does Solarwinds support).

  • I've been using a sql based method of building these things for several years and never got around to switching it to the SDK, but I've never had any problems with the dependencies I built that way.  Might be a possible workaround if there is a bug somewhere in the API dependency implementation. 

    This thread discusses a specific example of creating dependencies but you could rework the code to accomplish whatever you want and maybe compare if the ones created via sql exhibit the same problem as you are seeing with the API built ones?

    Automatic Dependencies Based On Custom Properties (Node Location)

  • Thanks for the response.  I do believe I've found my problem.  My script was not populating the ChildURI field correctly.  It didn't show anything amiss in the web gui when looking at the dependencies but when I looked at the fields in SWQL studio I could see the problem.   I tweaked the script and recreated the dependencies.  So far so good.

    Thanks.