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:
[[inputs.snmp.field]]
name = "hostname"
oid = "STORMSHIELD-PROPERTY-MIB::snsSystemName.0"
is_tag = true
[[inputs.snmp.field]]
name = "firewallName"
oid = "STORMSHIELD-PROPERTY-MIB::snsSystemName.0"
[[inputs.snmp.field]]
name = "model"
oid = "STORMSHIELD-PROPERTY-MIB::snsModel.0"
[[inputs.snmp.field]]
name = "version"
oid = "STORMSHIELD-PROPERTY-MIB::snsVersion.0"
[[inputs.snmp.field]]
name = "uptime"
oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
[[inputs.snmp.table]]
name = "interfaces"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"
[[inputs.snmp.table.field]]
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.