Hello,
Is there any way to query the Orion nodes with all the custom properties?
Thanks.
CluM09
Hi,
using the REST api you can perform a read on the node swis URI like so..
swis://hostname/Orion/Orion.Nodes/NodeID=1/CustomProperties
which will return all the possible custom properties and their values
more info is available here: REST · solarwinds/OrionSDK Wiki · GitHub
What was the end goal?
danofa,
Thank you for the quick response. I am sorry for being late in responding back to you.
Actually, I need to query all the nodes from SolarWinds including built-in and custom properties. I need this information to true up the SolarWinds inventory for my company.
I would assume that the syntax you provided is for one node only with a known NodeID. I am not familiar with SolarWinds REST api, and I have never used it. Do I need to use SwisSnapin snapin or I just use the Invoke-Webrequest or Invoke-RestMethod cmdlet from PowerShell or the curl utility?
Please give the actual syntax of the REST api command to perform the operation.
Thanks again.
Ah, well that changes a few things,
maybe the best bet in your case is to make a custom report, based on a SQL query
then you can do something like the following...
Select * FROM NodesCustomProperties cp
INNER JOIN NodesData nd on cp.NodeID = nd.NodeID
this will give you all the custom properties and all the data that applies to each node... if its too much information you can whittle it down with a SELECT IP_Address, Vendor, <insert column name here>, cp.* FROM ...
Hope this helps
You don't need to use a SQL query. If you want to do this in the reporting system, you can make a report for nodes that includes whatever properties you need, including custom properties, just by picking them from the list.
If you prefer to do this from a script, you can use a Query request to get a complete list of nodes including custom properties. In PowerShell this is done with the "Get-SwisData" cmdlet. See the REST API documentation page (linked earlier in this thread) for information about how to run a SWQL query through that channel.
Here is the equivalent SWSQL. This is pulling all nodes that have the name 'Cisco' and a custom property called Team that contains 'Telecommunications'
Select IP_Address, Caption, NodeID, _Group FROM Orion.NodesCustomProperties cp
INNER JOIN Orion.nodes nd on cp.NodeID = nd.NodeID
Where Caption Like '%Cisco%'AND Team Like 'Telecommunications'