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.

Managing dev nodes

FormerMember
FormerMember

So I currently have Chef code (Windows and Linux) that installs the SolarWinds agent and registers the nodes with the Orion server. Right now I've been testing this in the dev environment, but that has a lot of churn. I'm not sure the best way to delete the node from Orion when the VM is being shut down (adding an API delete step?), or if I should be looking at moving to a different model like node discovery... would that properly handle marking nodes as down and then reconfiguring the name/configuration if the IP gets recycled?

This is less of an issue for prod as we don't cycle servers very often there, and it's at predictable times so we can easily add a step to decommission them from Orion as part of the procedure. But dev does have a lot of churn, and we want to be able to test out our monitoring configurations there before prod... without being unnecessarily spammed about nodes going offline because the VMs were terminated. And the devs don't have access to remove nodes from Orion, either, so I can't ask them to clean things up as part of their process.

  • FormerMember
    0 FormerMember

    Any thoughts on this?

  • Feel free to modify this to suit. It originally had SQL to find multiple nodes with the same name and find the DOWN ones, hence the double sub selects. It is a workable SWIS agent deletion routine...

    $nodesToDelete = Get-SwisData $swis 'SELECT Agent.Uri AS AgentUri, Agent.Node.Uri AS NodeUri, Agent.Node.Caption as Name, Agent.node.NodeID as NodeID FROM Orion.AgentManagement.Agent where Agent.Node.NodeID IN 
    (SELECT nodeid FROM Orion.nodes where caption in (SELECT caption FROM Orion.nodes where PUT CONDITIONS HERE) )';

    # Are there any?
    if ($nodesToDelete)
    {
        $msg+= ("{0} INFO: Deleting ATM {1} `n" -f `
        ((get-date -Format s).Replace("T", " ")), (($nodesToDelete.name | Out-String).Replace("`n", " ")) );
        write-host $msg

    # Remove the Agent listing   
        for ($i=0; $i -lt $nodesToDelete.Length; $i++)
        {
            # Delete the Agent
            Remove-SwisObject $swis $nodesToDelete[$i].AgentUri
        }
        Start-Sleep -Seconds 5;

    # Delete the Node object
        for ($i=0; $i -lt $nodesToDelete.Length; $i++)
        {
            # Delete the Node
            Remove-SwisObject $swis -Uri $nodesToDelete[$i].NodeUri
        }
    }
    else
    {
        $msg+= ("{0} INFO: Can't find any duplicate and DOWN ATMs `n" -f `
        (((get-date -Format s).Replace("T", " "))) )
    }




  • FormerMember
    0 FormerMember in reply to mlandman

    Any thoughts on how to do this from a Linux node as well?

  • This block of code would be set up to execute on the orion server (or a system that is pointing at the orion server), it doesn't matter if the node you want to delete is linux, windows, or a router.  You define the conditions that you want to use to determine which nodes you are deleting on line 2

  • nclemons​ - You can do this via the OrionSDK in a script or as you suggested in an API call.. and that's the route I would take utilizing their REST fuctions. Link here:  REST · solarwinds/OrionSDK Wiki · GitHub