This builds on the sample scripts available in the Orion SDK Github called ImportListResources.ps1 ; ImportSelectedLIstResources_CPUMemory.ps1 ; and ImportSelectedListResources_Routing.ps1.
I posted about this on thwack seeking help, took a coffee break and then saw my typos and my issue was SOLVED! After 24 hours of hard work I bring this script to you!
Now, this will need to be modified for your environment as you will need to pass in your username and password. Also, if you do not run your scripts directly on your primary polling engine then you will need to add in lines to connect to the swis interface.
Also, this is a snippet from my ansible playbook - if anyone is interested I do not mind sharing the full playbook - just ask.
This covers the following sections of the List Resources wizard on whatever node is ran:
Routing
CPU and Memory
Volume Utilization (should be able to filter on volume name as well with how the volume import is done as its a two phase selection process but we are selecting all of the Volume Utilization tree with all drives)
Hardware Health
VLAN
Topology: Layer 2
Topology: Layer 3
Interfaces (Currently it is setup to filter and ONLY select those that match the following wildcards: ethernet, vlan, loopback, tunnel)
SAM: Asset Inventory - you can comment out this section if you do not want to import this for all of your servers
The query currently looks for all non ICMP polled nodes and then checks to be sure they are not in the following states: unmanaged, external, unreachable, unknown, and down. Once done it passes ALL node IDs and some other data along then parses each node on its own, selects the options available in list resources and leaves any other options previously selected alone. This does NOT deselect any options but this could be written to do so. Then it imports for that individual node before moving on. I have not yet ran this on my full environment just select environments and across three nodes (two cisco switches (one layer 2 and one layer 3) and a palo alto firewall) took 1 minute from start to finish.
I have about 3400 nodes in my environment so this ought to be fun!
Enjoy!
thwack forum post: https://thwack.solarwinds.com/products/solarwinds-observability-self-hosted/f/forum/104347/how-to-run-list-resources-via-swispowershell-sdk-for-the-interfaces-i-have-the-rest-figured-out-so-far
EDIT: I had to update the XML Import - I forgot to verify if the interface pollers were assigned - they were not but this has been fixed and reuploaded!
EDIT 2: I updated the code to add a timeout function as when I was running against my own environment it kept getting hung up on an infinite do while loop if a node went down after I had obtained a list to work with. I also made the variable $swqlQuery as a paramter of the script so you can scope it out on the fly before running it. I have done this so I can have ansible run a workflow per polling engine. This was done because I was having a timeout after 10 hours of runtime which is the default kerberos timeout and I havent been able to workaround it in my environment so far.
Edit 3: I did want to provide an update on how I personally use this at my organization. We use Ansible Contoller (Ansible Tower formerly) to run this via a workflow. I have scoped out each job within the workflow per pollling engine and then further via per vendor type and if a vendor has multiple polling types (SNMP, Agent, WMI, WinRM) then also per polling type. This allows for some jobs to run in 5 minutes and others to run around 4-8 hours. Overall I have 120 jobs that take from 4AM Saturday to the following Tuesday in the afternoon sometime. So while it runs for several days I only have this workflow run once a month. I also only see issues with Linux servers being polled via Agents that do occasionally timeout during the jobs. All other devices work fine for our implementation it just takes awhile to run!