Monitoring Interface Grafana/InfluxDB Stormshield

Hello Community,
I’m new to the world of Grafana (Telegraf/InfluxDb)and I’m trying to monitor a stormshield firewall with SNMP through influx and telegraf.

More specifically, I’m trying to monitor interfaces, and I would like to display traffic on my interfaces, but one at a time.
So far, I have created a global variable name interfaces and it can display through the dropdown menu all my interfaces available.
Whenever I select a interface in the dropdown menu, I would like to display this interface traffic on the graph panel for instance.

The main issue is that I have to use Flux language and I’m not familiar with these queries.
Here is my telegraf.conf:

name = "hostname"
oid = "STORMSHIELD-PROPERTY-MIB::snsSystemName.0"
is_tag = true

name = "firewallName"
oid = "STORMSHIELD-PROPERTY-MIB::snsSystemName.0"

name = "model"

name = "version"
oid = "STORMSHIELD-PROPERTY-MIB::snsVersion.0"

name = "uptime"
oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"

name = "interfaces"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"

name = "interfaceName"
oid = "IF-MIB::ifName"
is_tag = true

and here is my query so far:

from(bucket: "snmp_sns")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["hostname"] == "${hostname}")
  |> filter(fn: (r) => r["_measurement"] == "interfaces")
  |> filter(fn: (r) => r["interfaceName"] == "${interface}")
  |> filter(fn: (r) => r["_field"] == "ifHCOutOctets")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "mean")

with hostname/interfaces being global variables that I can select.

The problem is Grafana says “No data”. But the query works in InfluxDB script editor.

The other issue is that I have no idea if my query is the way to go to get correct average traffic informations on my interface. I’ve seen that I should use the math function to display speed in bits/sec but also the derivative function (but I’m not sure why). I have no idea about the time range.

What could be the correct query to achieve what I want?

Thanks a lot for your help.

What is your time range filter on grafana?

Hi yosiasz, my interval is set up to 30s on the telegraf.conf file.
On grafana, if you mean the data sources configuration page, the min time interval is blank by default but it appears to be 10s.
Not sure if I’m looking at the correct place?

On the top right there is a date time filter in grafana

Oh, it says LAst 6 hours CEST.