etichy / grafana-swis-datasource

DataSource plugin for grafana to access SolarWinds data via SWIS REST API
MIT License
52 stars 11 forks source link

Creating Interface Utilization % #11

Closed PhilzKoffee closed 3 years ago

PhilzKoffee commented 3 years ago

Hey Edward,

Thanks for creating this plugin for Grafana, it really saves a ton of time for someone who is brand new to coding and wants to integrate with the already existing SolarWinds deployment at my organization. I am brand new to Grafana, and I tried to look over your past posts to understand how to create a chart or graph for utilization of a single port over time, I can get the data but I am unable to get a time stamp of some sort, isn't there a way to just create a date and time stamp every time the query is used and use that? My query is super simple:

SELECT
LastChange as time, NodeID, InPercentUtil as MPLSInput, OutPercentUtil as MPLSOutput, LastChange FROM Orion.NPM.Interfaces WHERE NodeID = '5468' AND Index ='6' GROUP BY LastChange, NodeID, MPLSInput, MPLSOutput ORDER BY time DESC

My problem is that LastChange is not an accurate date/time sample. I tried to find a DM option here, and if you have any thoughts on some sample code using your plugin I think it would greatly benefit the community.

Cheers!

etichy commented 3 years ago

If you need just some datetime to satisfied grafana needs, you can use function getdate().

SELECT getdate() as dt, i.Node.Caption, InPercentilUtil FROM Orion.NPM.Interfaces i