Graphing correct network values

Hi everyone,

I’m trying to set a dash for monitoring my network activity but i can’t display the correct values for network bandwidth and traffic.

I’ve tried to use perSeconds() and scale(8) as well as integral() and derivative()

Using this query alias(collectd.mls01_local.interface.eth0_12.if_octets.tx, 'out ') and outputing the units to bytes i get the correct traffic but i can’t figure out how to convert it so i can get the network speed.

Also if the router is rebooted the counter gets reseted, is there anyway to keep the overall sum of the total traffic?

If anyone can share some light on this i would appreciate.

Regards.

I usually use the nonNegativeDerivative function to get around counter resets.

I think you by network speed you mean the rate per second/minute?

Does scaleToSeconds work:

scaleToSeconds(nonNegativeDerivative(collectd.mls01_local.interface.eth0_12.if_octets.tx),1)

Hello, I’m stuck on the same situation: monitoring network traffic.

What I’d want:
Just a simple graph with bars (one per hour) with the total amount of bytes of my network interface.

What I have:
I have a script that runs every 5 minutes and get the bytes difference from the last run, then it send the difference to graphite.
I have a grafana graph with a function like integralByInterval(test.vnet0.rx, “1h”) and the result is not what I want: Instead of having only 1 “fat” bar per hour with the total amount of MB consumed, I have multiple bars each hour: on the left side (the first minute of the hour) the bar is at 0 bytes, and on the right side (the last minute of the hour) the bar measures what I want, the total amount of traffic generated on the specified interval (1h).
I’d want to have only the total amount of traffic each hour, I’m not interested to know the details of each minute…

Many thanks.

Hi.

I’ve adjusted collectd to report every 10s to match carbon .conf and i’ve got the function scaleToSeconds working.

As far as the total amount each hour i don’t know how to plot that graph because i’m getting the same problem even with the total amount of consumed MB on all interfaces.

Sounds like you both need the summarize function.

Here is an example on the demo site using summarize by summing per day:

http://play.grafana.org/dashboard/db/grafana-trend?panelId=1&fullscreen&edit&orgId=1

1 Like

Really… that simple!! Many many many thanks @daniellee

1 Like

Here again.

My setup is pretty perfect. I setup a daily graph with each hour summarized, then a monthly graph with each days summarized and a yearly graph with months summarized. I used the “Time range override” on thesee graphs so they are always as they have to be.

Anyway, I noticed the behavoir of the summarize function:selecting 1 day as interval, it sum all the values from now-24h to now. That’s not perfect because the graphs does not sum each day from 00:00 to 23:39, but with a different interval (last 24 hours).
On the yearly graph is ever worst, having months starting at 11th day (because today is May 11, 2017).

Is there a way to summarize from a specific hour (midnight) on the montly graph and a specific day (1st) on the yearly graph?

Thanks!

The summarize function does do some automatic aligning, especially for smaller values. The third parameter alignToFrom if set to true allows you to align the data with the chosen time range. So if you choose the from and to dates and times to align with 00:00 on the 1st day of the month then the data should be summarized to align.

Ok, got it. After setting it to “true”, I had to remove the “Override relative time” that was previously set to “1M” and using the graphite dashboard to request the time range “This month” I’ve got the result, showing 2 bars on 10th and 11th of May (I started yesterday to collect data).
The problem is that If I select “Last 3 hours” that graph become total useless, this was the reason why I previuosly used the time override set at 1 month. Unfortunately, setting the overrride results in a single bar instead of two (2 days)…

Is there a method to force the graph to show “This Month” with the sum of the metric for each day?

Many Thanks for your patience.

You can use now/M in the Override relative time field together with summarize function and a 1d interval.

Using now/M on that field is not accepted by the UI… Grafana v4.2.0 (commit: 349f3eb)

It this a new feature?

No, sorry. You’re right. now/d works but not now/M.

It seems that now-1M/M is working instead. Am I wrong?

Yes, that works I think. now-30d works too. But that is the last 30 days rather than this month (from the 1st of the month to now).

Ok, last 30 days seems accebtable for me. Anyway I did not understood why now/M does not work… why?!?

The validation is a bit too strict in this case. I’ll see if I can fix it and get it included in the 4.3.0 release.

I added This month so far so that now/M will work.