Hi there,
I have a time series set up in Influxdb, it’s actually data written by ntopng, it is bytes in and bytes out by host. I am trying to mimic what the ntopng dashboard does which is this
So I want to set up the breakdown graph, can any please give me any pointers?
Thanks
Jason
Are you able to query influxdb from your grafana instance?
If yes, am I correct that the breakdown graph you are talking about should be representation of the ratio of sent and rcvd?
OK maybe trying something like this will work:
SELECT cumulative_sum(sum("sent")) FROM "metrics" WHERE ("ip" = '123.456.78.9') AND $timeFilter GROUP BY time(1m) fill(0)
SELECT cumulative_sum(sum("rcvd")) FROM "metrics" WHERE ("ip" = '123.456.78.9') AND $timeFilter GROUP BY time(1m) fill(0)
Then make sure you enable Stack
and Percent
in the Display options (Grafana7).
The queries can also be consolidated but I was too lazy to do that atm
Ok, great, thanks for that, I am still playing but that is a great starting point.
Much appreciated.
I am still having issues with this, this is what it is displaying at the moment
So it is displaying 2 graphs per ip address, I would like to merge them into 1. I think a subquery might be the answer?
My 2 queries look like this
SELECT cumulative_sum(last("bytes_sent")) FROM "autogen"."host:traffic" WHERE ("host" != '192.168.3.1' AND "host" != '192.168.3.21') AND $timeFilter GROUP BY time($__interval), "host" fill(null)
SELECT cumulative_sum(last("bytes_rcvd")) FROM "autogen"."host:traffic" WHERE ("host" != '192.168.3.1' AND "host" != '192.168.3.21') AND $timeFilter GROUP BY time($__interval), "host" fill(null)
Any more clues please?
I can use the graph panel, how would I address the sub query?