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.

Updating node details poller from Powershell

I searched and found an old post on this but couldn't see any answer so here goes

I am trying to search all nodes and update specific ones, based on machine type, with the node poller.

I have looked in the nodes.pollers table but cannot see the new node poller appear here when I update one via the GUI.

Any tips on where to look or sample code to update the node details poller to a custom one (already created).

Thanks

  • , do you see it in Orion.DiscoveredPollers or Orion.DeviceStudio.Pollers?

  • Hi, I can't see it in Orion.DiscoveredPollers, but do see the node detail poller ref in Orion.DeviceStudio.Pollers.
    How would I reference the PollerID from the devicestudio.pollers table to a node?

  • , i think you might be able to do it from Orion.DeviceStudio.PollerAssinments

  • Great, looks like there is a reference in there for nodes.
    How would I edit the row rather than create a new row in the table with new-swisobject? (I am using powershell)

  • To update a SWIS entity, you use the Set-SwisObject.  You'll need your SWIS Connection (duh, right?), the URI of the thing to update and then a hashtable of the properties to change.  Roughly, it looks like this:

    Set-SwisObject -SwisConnection $SwisConnection -Uri 'swis://server.thing/long/uri/path?id=11' -Properties @{ Prop1Name = 'Prop1Value; Prop2Name = 'Prop2Value' }
    Above I used strings as the property values, but I normally build the hashtable beforehand and then send it in as a variable.  I talked about it at the most recent THWACKcamp and provided samples in the Scripts Content Exchange (this one shows the Set-SwisObject work.)

  • Thanks, I have the following code now as part of a loop to go through all my devices of a particular type, although not sure what the uri for the Orion.DeviceStudio.PollerAssignment table would be as I cannot see a URI in the table.

    $Query = "SELECT ID, PollerID, NetObjectType, NetObjectID, Enabled FROM Orion.DeviceStudio.PollerAssignments WHERE PollerID='3aa00bea-4121-4da4-b1de-ab82ba07ecc6' AND NetobjectID=" + $nodeid
    $reply=get-swisData $swis $Query

    if ($reply.Enabled -eq $false) {
     $poller = @{
      ID=$reply.id
      PollerID=$reply.pollerid;
      NetObjectID=$reply.NetObjectID;
      NetObjectType="N";
      Enabled = $true;
      }
     write-host "- Changing Node Details Poller to true" -ForegroundColor Green
     set-swisobject -SwisConnection $swis -Uri ???? -Properties $poller
     }

    I found the following on thwack but its a couple of years old so was hoping it was integrated into Swis now.

  • The URI is an inherited (natively hidden) property in SWIS (although most every entity type has one).  You can see it here in SWQL Studio:

    Just add the URI to your query output and go from there.


    M. Night Shyamalan twist incoming...

    And then I noticed the icon and saw the documentation for Orion.DeviceStudio.PollerAssignments:

    Via the API, this cannot be updated, deleted, or added.

    I also checked to see if there are any verbs around pollers, and I don't see any there either.

    SELECT [Verbs].EntityName AS [Entity]
         , [Verbs].Name AS [Verb]
         , [Verbs].MethodName
         , [Verbs].Summary
    FROM Metadata.Verb AS [Verbs]
    
    WHERE [Verbs].CanInvoke = 'True'   -- can be invoked via API
      AND [Verbs].IsObsolete = 'False' -- still supported
      AND [Verbs].IsInternal = 'False' -- External calls are allowed
      AND (
             [Verbs].Name LIKE '%Poller%'
          OR [Verbs].Summary LIKE '%Poller%'
      )

    Is this something you normally do in the "Universal Device Poller" application on the SolarWinds Platform server?
     Or via the Manage Pollers in the web console?

    Because both seem to allow you to do what you are asking in a bulk fashion.

    There's a chance I'm not understanding the specific problem you are trying to overcome with the API.

  • Thanks for the detailed reply.

    The node details poller can be bulk added as per your last image, however I am putting together a script that would run every evening to check that the correct pollers have been added to our Nodes (Alcatel in this case).

    If anyone then adds a new Alcatel node, the script will run that evening and automatically add the required node detail poller and also any universal pollers too.

    The script is working fine on the custom properties and universal pollers, its just the node details poller that I hit an issue with.

    I have two different node detail pollers depending on the software code on the devices as OIDs are in different places.

    Richard

  • As of today, it looks like you can't use the API to assign the poller.  Sorry about that, but if you feel like it's something that's needed, I'd recommend putting in a Feature Request for the platform.

  • Thanks, I'll submit a feature request :-)