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.

How to use RESTful API

I have a large number of linux systems for which I need to do a number of SolarWinds configuration tasks, but lets pick one:

The systems have registered themselves by running swiagent in push mode.  By default, they're monitoring CPU and memory and network traffic.  I want them to monitor specific file system mounts (/, /tmp, and /var) and not others (not /boot, since it doesn't change, and not /projects, because it's an NFS mount - monitor that on the filer).

I'd like to automate turning on that monitoring from the Linux systems themselves, and the RESTful API would seem to be a good way to do that.  I presume I need to retrieve the NodeID, then retrieve some identifier for the volume, then invoke some verb to enable monitoring of the volume.

These curl invocations work:

curl --user 'swiagent:*************' -k https://10.1.1.248:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Uri+FROM+Orion.Nodes+WHERE+Caption+=+\'apk0clio00\' | python -mjson.tool

curl --user 'swiagent:*************' -k https://10.1.1.248:17778/SolarWinds/InformationService/v3/Json/swis://pdx0netmgmt01.tqs.com/Orion/Orion.Nodes/NodeID=6079 | python -mjson.tool

But this doesn’t:

curl --user 'swiagent:*************' -k https://10.1.1.248:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+Uri+FROM+Orion.Nodes.Volumes+WHERE+NodeID=6079 | python -mjson.tool

I feel like there's important things I don't understand, and I don't know how to find the answers - and my search results show I don't know how to ask the questions.

  • If you want to get Uri's of volumes, you can get it with this query: SELECT Nodes.Volumes.Uri FROM Orion.Nodes WHERE NodeId = 6079.

    You could also fetch data directly from Orion.Volumes and filter them with NodeId like this: SELECT Uri FROM Orion.Volumes WHERE NodeId = 6079

  • Thank you.  That does not throw an error,  but it returns an empty list.

    Apparently, there's a missing step before the volumes appear in the volumes table.

    When swiagent registers the host, by default it monitors CPU, MEM, and network interfaces.  In the GUI, I go to "List Resources", wait 10 seconds, click the selection boxes for the file systems I want to monitor, and click submit.

    What is the RESTful API equivalent?

    Is there a way to instrument the browser to watch what it's doing,and would the result be useful (I can imagine the browser making requests entirely unsuited for a non-gui environment)?