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.

Enable/Disable Components

When doing an update post to attempt to enable/disable specific components of an application monitor that's been applied to a node, it actually pushed the update to EVERY component in the system (so disabled every component on every application monitor in the entire system). Can someone assist with the proper way of doing this?

I've tried 2 different methods: Using the SWIS URI in the POST URL with the payload simply being the JSON string to set "Disabled": true, and also the BulkUpdate URL with the single URI and parameter defined in the payload. Both methods did the systemwide toggle.

Thoughts? Thanks!

  • I assume you are disabling a component on the “template” level rather than on the assigned template level. I haven’t done this via SWIS yet but this sounds a lot like it.

    can you show us the relevant code snippet?

  • No, the assigned template level.

    Long story short...template will have numerous components, all disabled except for a templated component. What I'm looking to do is effectively a true up script. Hit the device I'm bringing into SW to see what elements it has, once I have that, script assigns the template to the node (no problems here), then loops through the components and 1) disables the template component and 2) enables any component that it needs too based on the elements pulled earlier.

    No real code snipped, just testing initial stuff in Postman for now.

    URI based URL:

    https://<IP>:17778/SolarWinds/InformationService/v3/Json/swis://<name>/Orion/Orion.Nodes/NodeID=214/Applications/ApplicationID=21/Components/ComponentID=189 

    with the following payload:

    {
    "Disabled": "false"
    }

    BulkUpdate Method, i don't have saved in Postman at the moment, but it was something along the lines of (following the documentation from github's REST wiki (https://github.com/solarwinds/OrionSDK/wiki/REST)):

    https://<IP>:17778/SolarWinds/InformationService/v3/Json/BulkUpdate

    With Payload:

    {
    "uris": [
    "swis://<name>/Orion/Orion.Nodes/NodeID=214/Applications/ApplicationID=21/Components/ComponentID=189"
    ],
    "properties": {
    "Disabled": true
    }
    }

    The effect of both of these toggled every single assigned component in the entire environment...for scope, like an idiot, I had initially tested on production, and it toggled all 10k+ assigned components. Was a fun afternoon...

  • I replied, but these lovely forums marked it as spam for whatever reason. In summary, until the write up gets brought back:

    1) Not on the template level, on the assigned to node level.

    2) Both methods, direct update using component's URI and the BulkUpdate using the component's URI were pulled from https://github.com/solarwinds/OrionSDK/wiki/REST for Update and Bulk Update sections respectively.

    3) The changed property value was JSON key/value "Disabled": true

    4) No code at the moment, just Postman testing

    Even using the component's direct URI, all 10k+ assigned components (irrelevant of application monitor/template, literally EVERY component in the environment) got toggled by both API calls. As if the underlying SQL command that's updating the values was missing a "where componentID = ##" and just processed it for every component in the table.

  • I received your answer by email notification. At first glance it seems that you are doing it correctly.
    I am mostly working with PowerShell scripts to do API related automation, so I need to get my knowledge a bit up to speed. For the time being, I am pinging the REST API Master if he has an Idea.
  • This does sound unexpected. I have tested it and the behaviour is the same in my lab. FYI  

  • That's what I was afraid of, that this wasn't isolated...

  • I haven't used this method to disable a component monitor before and there is no SWIS verb available to do so.  Have you seen the URI for the components documented somewhere?

  • It's nothing special, just a typical update based on the REST documentation. As you can pull the SWIS URI like any other object, and update it like any other object (at least assumed), what would be unusual or anything about it?

  • Do you have another method of doing this? I'm all ears, as I couldn't find any documentation stating another method leveraging REST.

  • Bumping this to see if anyone has any other method of doing this that won't break everything.

    To simplify: 1 SAM template with 3 components (the real one has many more, again, simplification). After applying template to node, I need to disable component 1 and 2, and enable component 3 on Node 1...disable component 1 and 3, and enable component 2 on Node 2. Does anyone have a means of doing this, or is the functionality above the only way (which doesn't work properly)?

    Thanks