telegraf output bytes send end recv are cummulativ

Started by vikozo, August 20, 2022, 09:48:21 PM

Previous topic - Next topic
Hello
i have activated telegraf the network traffic part

i found out
there is only one port and no label which port it is! Belive it is the WAN Port, hope so!??
then bytes send and recv are cumulativ!
Packets send and recv are cumulativ, too!

but in the opnSense Gui Reporting Traffic the data looks the way i wish

have a nice day
vinc
apu2c4 / wle200nx / 240 Disk --> Firewall | FW-03
---
OPNsense 22.1.6-amd64
FreeBSD 13.0-STABLE
OpenSSL 1.1.1n 15 Mar 2022

the Part with the different Ports i found out.
But still the value are cumulative and not what actuality happen
apu2c4 / wle200nx / 240 Disk --> Firewall | FW-03
---
OPNsense 22.1.6-amd64
FreeBSD 13.0-STABLE
OpenSSL 1.1.1n 15 Mar 2022

That is expected and how Telegraf captures the data from FreeBSD in the case of OPNsense (Telegraf net plugin documentation: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/net/README.md). It is up to you with whatever timeseries database and graphing tool you are using to interpret the metrics using rate of change functions or difference functions to get transfer rates or bytes send/received over a period of time. In my case I have Grafana with Influx 1.8 and use the following queries to get WAN port transfer rates:

Received: SELECT non_negative_derivative(mean("bytes_recv"), 1s) * 8 FROM "net" WHERE ("interface" = 'igb0') AND $timeFilter GROUP BY time($__interval) fill(none)

Sent: SELECT non_negative_derivative(mean("bytes_sent"), 1s) * 8 FROM "net" WHERE ("interface" = 'igb0') AND $timeFilter GROUP BY time($__interval) fill(none)

igb0 is my WAN port.