11 Replies Latest reply on Sep 15, 2017 12:46 PM by nick_scott

    Automation of adding nodes into Solarwinds

    simonp73

      Hi All

       

      We are looking at using Chef to automate server deployment and part of this work would be:

       

      1. Lookup in IPAM the next available address in a subnet, reserve it and add the hostname to the reservation

      2. Chef passes a name/IP and node creation (and possible node type or template name) request to Solarwinds for monitoring

      3. Solarwinds adds the above node and enables a predefined set of base monitors.

       

      The next parts are to do with Chef running scripts to talk to Solarwind

      1. 1.       Chef sends a script to disable monitoring of an existing node
      2. 2.       Chef sends a script to enable monitoring of an existing node
      3. 3.       Chef sends a script to delete an existing node

       

      If anyone has any automation style scripts they can share, or any pitfalls to avoid when doing this work I would appreciate any input

       

       

      Thanks

       

      Simon

       

        • Re: Automation of adding nodes into Solarwinds
          bluefunelemental

          Same workflow we are planning to build with Puppet. Using combination of machinetype and "system" custom prop as a template identifier not too un-similar to NCM device templates but with the ability to have different templates for the same machinetype.

           

          Using the example scripts provided in the SDK to add node, add custom props, and discover and filter out, based on template, interfaces.

           

          Areas we are concerned about include limited IPAM swis verbs and adding asset inventory by SDK.

           

          What language do you plan to write the scripts in that call the SWIS API?

           

          Thanks,

          Christian

          • Re: Automation of adding nodes into Solarwinds
            tomelnik

            We're using Ayehu eyeShare to automate these kind of processes by simply creating a workflow that dynamically could add nodes or whatever. eyeShare has built in integration for solar winds for managing alerts, but you could simply integrate with SolarWinds API to perform these actions.

             

            Thanks,

            Tom

            • Re: Automation of adding nodes into Solarwinds
              jbilbro

              Can anyone share Chef recipes to manage adding/modifying/deleting SolarWinds nodes?  We're interested in doing this and would love to see what you guys came up with.

               

              Thanks,

              -Jeff

              • Re: Automation of adding nodes into Solarwinds
                reachravi70

                Hi,

                 

                Please correct me if I am wrong here.

                 

                Solarwinds has Auto Discovery Wizard which has options to add nodes and enable monitors.

                 

                Why do we need Puppet/Chef to add node to Solarwinds if this option is available within Solarwinds itself.

                 

                Trying to understand

                 

                1) If there is any limitation in Solarwinds and that is why you are adding nodes through Puppet/Chef. If so can please share the scripts.

                 

                Highly appreciate your help in advance.

                 

                Thanks

                RaviShankar

                • Re: Automation of adding nodes into Solarwinds
                  simonp73

                  We are automating our server builds both on-prem and in the cloud so we want the Chef system to automatically add the new nodes and give them the correct monitors

                  • Re: Automation of adding nodes into Solarwinds
                    armandomaya

                    Hi Simonp73,

                     

                    This script in powershell add a node using OrionSDK, you can see this example in GitHub in the next link OrionSDK/Samples/PowerShell at master · solarwinds/OrionSDK · GitHub

                     

                    # This sample script demonstrates how to add a new node using CRUD operations.

                    #

                    # Please update the hostname and credential setup to match your configuration, and

                    # information about the node you would like to add for monitoring.

                     

                    # Connect to SWIS

                    $hostname = "localhost"

                    $username = "admin"

                    $password = New-Object System.Security.SecureString

                    $cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password

                    $swis = Connect-Swis -host $hostname -cred $cred

                     

                    $ip = "10.0.0.1"

                     

                    # add a node

                    $newNodeProps = @{

                      IPAddress = $ip;

                      EngineID = 1;

                     

                      # SNMP v2 specific

                      ObjectSubType = "SNMP";

                     

                      SNMPVersion = 2;

                     

                      # === default values ===

                     

                      # EntityType = 'Orion.Nodes'

                      # Caption = ''

                      # DynamicIP = false

                      # PollInterval = 120

                      # RediscoveryInterval = 30

                      # StatCollection = 10 

                    }

                     

                    $newNodeUri = New-SwisObject $swis -EntityType "Orion.Nodes" -Properties $newNodeProps

                    $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

                     

                    # register specific pollers for the node

                    $poller = @{

                      NetObject="N:"+$nodeProps["NodeID"];

                      NetObjectType="N";

                      NetObjectID=$nodeProps["NodeID"];

                    }

                     

                    # Status

                    $poller["PollerType"]="N.Status.ICMP.Native";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                    # Response time

                    $poller["PollerType"]="N.ResponseTime.ICMP.Native";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                    # Details

                    $poller["PollerType"]="N.Details.SNMP.Generic";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                    # Uptime

                    $poller["PollerType"]="N.Uptime.SNMP.Generic";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                    # CPU

                    $poller["PollerType"]="N.Cpu.SNMP.CiscoGen3";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                    # Memory

                    $poller["PollerType"]="N.Memory.SNMP.CiscoGen3";

                    $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                     

                     

                     

                     

                     

                    On the other hand, you need connect with SWIS to IPAM.IPNode entity y search if the ip adores is int the system. This is a example for this;

                     

                    Get-SwisData $swis 'SELECT TOP 1 I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.DisplayName = ''1.1.0.0/24'''

                    Get-SwisObject -Uri (Get-SwisData $swis ('SELECT Uri from IPAM.IPNode where IPAddress = ''' + $ip + '''')) -SwisConnection $swis

                    • Re: Automation of adding nodes into Solarwinds
                      simonp73

                      Yes that is what we adapted to our needs.

                       

                      If you check it out my original post on this matter was 3 years ago.  A lot has changed and we now automate all of our linux builds ans script the addition of them to our various monitoring systems

                       

                      Regards

                      Simon