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.

Update multiple records

Just got started with Orion API. I have the task of updating a big number of nodes. Here are the steps involved:

1 - Login to Orion

2 - Navigate to Manage Nodes

3 - In Manage Nodes->Show Nodes enter an IP address

4 - If the IP address is not found click on Add Node

5 - In Add Node ->Define Node->Polling Hostname or IP Address:

     Enter an IP address

6 -  In Add Node ->Define Node->Polling Method:

     Enable Status Only: ICMP

7 - In Add Node ->Define Node->Polling Engine:

     select a Polling Server

8 - Click on NEXT

9 - In Add Node->Add Application monitors

     Click on NEXT

10 - In

      BBB = Yes

      Ops = Yes

      Site = AFACDY (for this example, it will change with each IP you add)

      Type Of Device = Circuit

11 - Click OK, ADD NODE

All these steps could be summed up into SWQL to searching for a record and if the record doesn't exist, run a CREATE query to add it.

Again, being new to SWIS, I have downloaded and installed SWQL Studio. I have been able to run queries; so far that's where I stand.

Could anybody point me towards the tools I can use for my project?

Thanks

  • issakeitala​ :

    1: what are you trying to do? Are you solely adding nodes via doing ping + SAM templates + some custom properties?

    2: Are you modifying existing nodes or solely creating new nodes?

    3: How often do you do this? There is a network discovery that may work for this and/or you can edit multiple nodes at the same time from that manage nodes page.

    There are indeed ways to script this but I would clarify those first few questions before assuming SWQL is a must. 

  • I have this list with IP addresses and hostnames of devices we have in the field. First, by using the IP addresses I need to find which ones are already in Orion and which ones are not. The ones that are not need, to be added as new nodes. The ones that are, need to be edited. If it's possible to use the manage nodes that would be great.

    Thanks

  • So, relatively good news. You can use discovery to simply try to add everything and it won't cause duplicates if you already have them in orion. You can even just copy + paste the ip addresses or hostname lists, or just tell solarwinds what subnets to use if it's an entire subnet. Look into settings -> network discovery and create a new discovery. There are posts about how that works in thwack, too.

    What you can do with manage nodes is edit a bunch of node properties at the same time like address, etc. You don't use that to add a bunch of nodes at the same time. You can also edit custom properties through the custom properties editor at settings -> all settings -> manage custom properties. That one is the fastest way to edit one property across a bunch of nodes.

  • I'll create a new discovery and I'll see whether it's possible to enter my list of IP Addresses which are all from different subnets.

  • Adding the list of IP addresses worked well. The IPs that were already in NCM were skipped. The ones that weren't were added.

    For the ones that have been added, I need to update their hostnames. I also need to set the following properties as such:

          BBB = Yes

          Ops = Yes

          Site = ""

          Type Of Device = Circuit

    What's the way to do this with network discovery?

  • You just did the part for discovery. The wording for the tool is "network discovery", but calling it discovery is accurate.

    For updating the properties, you have two easy options and one scripting one.

    1: use the mange nodes page. Search for a matching criteria such as subnet, hostname, etc. Get your partial match, select them all, hit edit node. Then you can update anything on that page field by field for all the selected nodes. This is the easiest way.

    2: use the custom properties editor. This is more like editing a web-based spreadsheet but contains whatever you want to edit. Good if you want to edit the group you find from searching A and then the group from searching B in less clicks. Faster, but interface is not as intuitive.

    3: script it using SWiS (this is where the SWIS comes in)

    There isn't a way to tie that to discovery, it's not what discovery is for technically speaking. Discovery is for updating/adding nodes, not updating/adding their custom properties etc.

  • Thanks again for your very useful directions and for clarifying the use and terminology of the "network discovery",.

    The 1 and 2 methods will not work here because the items(IP addresses) have nothing in common; I cannot group them.

    That's why I thought a script would work better.

    This is what I would do, if I knew how:

    1- Select a record from the database using the IP address

    2- Update the different fields in that record

    3- Loop to the next IP address

    How do I do something like that with SWIS?

    I'm reading up on SWIS, but I'm not there yet.

  • Easiest way to use SWIS is via powershell. Do the items in question not share anything in common? It doesn't have to be an IP. A hostname, or literally any value they share would work.

    SWIS has it's own forum and tdanner​ is the solarwinds guru for the API itself. If you know some SQL it's not so bad, you'll need almost nothing for powershell. If you are unfamiliar with powershell, there was some documentation on how to integrate API's with solarwinds and it talked about how to configure powershell as well a little. SolarWinds Lab #40: Awesome Alert Integration: Slack, Service Desk and More