Hey all,
I wanted to let you know I wrote up a document on how to connect your Grafana instances to the SWIS API for those of us who are using it. The old plugin has not worked for a long time now and connecting directly to the database is discouraged, but I took some time and figured out what we needed to do to make it work with the Infinity plugin and wrote it up since I've seen a lot of people saying they had a hard time with it.
https://github.com/grafana/grafana-infinity-datasource/discussions/1137
SolarWinds API
Below example shows about fetching data from the SolarWinds API.
URL : https://github.com/solarwinds/OrionSDK
- Create your new Infinity data source, pick a descriptive sounding name like "SolarWinds" and go to the Authentication tab.
- Choose Basic Authentication.
- Set the username and password for an account that has access to your SolarWinds web console. This account does not require any special permissions and the apply will apply any account restrictions or view limitations that apply to the account.
- For the Allowed hosts you should enter the URL you will use to connect to SolarWinds, this could be an IP, hostname, or DNS name depending on your environment.
- Go to the URL, Headers and Params tab.
- Put in the same URL you used for the allowed hosts and specify the port to connect to the SolarWinds API. For SolarWinds versions newer than 2023 this will usually be 17774, older versions could still be using 17778. To save yourself a lot of copy paste later also tack on the path for the query API, so you shoudl end up with something like
YOURSERVER:17774/.../Query
- Go to the Network tab.
- In most cases you will need to set the option to Skip TLS Verify as SolarWinds normally uses a self-signed cert for their API.
- Go to the Health check tab.
- This is optional, but its a good idea to enter in the following URL for a simple way to verify the API is reachable.
- https://YOURSERVER:17774/SolarWinds/InformationService/v3/Json/Query?query=SELECT+TOP+1+Uri+FROM+Orion.Pollers
- At this point you should be able to Save and Test your connection successfully.
Dashboard Panels
- Go to Home > Dashboards > New Dashboard > Add Visualization > Select your SolarWinds data source.
- Make sure the Type is JSON, Parser is Backend, method is GET, and your URL can be blank because we already set it at the data source.
- Recommended If you set the parser to Backend you will be able to create Grafana alerts and enable enterprise query caching and other features from this data.
- Expand the Headers, Request params and add a URL Query Param.
- Set the Key to
query
and for the value paste in whatever valid SWQL query you like. - Under Parsing options in the Rows/Root box add the regex
$.*
to have the backend parser properly identify the field we want to include.
- This is a quick example of a Grafana recreation of the Node Details view in Orion:
If you want more examples of real world SWQL queries I maintain a collection of queries here, and will be building out some example dashboards that you can just import to get a head start Github/Mesverrum/