Network traffic display

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

Screenshot from 2020-07-01 17-27-35

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?

Yes for both questions :grinning:

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 :slight_smile:

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?

  1. You are not using the graph panel so I am not sure if I can help you to achieve what you intend to do.
  2. Do not use fill(null) if you want to stack values since it will result in wrong representation.

I can use the graph panel, how would I address the sub query?