2 Replies Latest reply on Feb 17, 2016 1:56 PM by lazypete

    Adding UnDP to a node using python

    lazypete

      Hey guys

       

      I've been working on writing a script to automatically adding new servers inside Solarwinds monitoring suite.

      So far so good, I have been able to add a node, update it's custom properties, delete it, add pollers and stuff.

      I also have seen this qustion asked before but only for Powershell, not python. And most of the time they talk about

      pollers, not the UnDP.

       

      What I would like to accomplish is adding the Universal Device Pollers (UnDP) to a node.

       

      Just like if I did it via the web GUI.

      Manage node -> check the node -> poolers

       

      Then I would like to add the vmGuestOS and vmGuestState UnDP.

       

      Anyone have pointers?

      Docs I could read about that?

      Anything?

       

      I have searched google to no avail.

        • Re: Adding UnDP to a node using python
          lazypete

          Ok I got it to work with python.

           

          Here's how I've done it, considering I already have a node id and a swis instance created:

           

          def addCustomPoller( swis, nodeid, custPollerList ):

           

              for custPoll in custPollerList:

                  result = swis.query("SELECT CustomPollerID FROM Orion.NPM.CustomPollers WHERE UniqueName=@CP", CP=custPoll)

                  props = {

                      'NodeID': nodeid,

                      'CustomPollerID': result['results'][0]['CustomPollerID']

                  }

                  swis.create('Orion.NPM.CustomPollerAssignmentOnNode', **props)

           

          addCustomPoller( swis,  nodeid, ['vmGuestOS', 'vmGuestState', 'laLoad'] )

           

          This will search for 3 CustomPoller named vmGuestOS, vmGuestState and laLoad

          Get their CustomPollerID and then add these to a NodeID..