Hey,
I’m using telegraf to collect SNMP traffic stats for interfaces on a cisco switch, in doing so I am also getting the ifDescr and ifAlias and storing them as tags in influx.
ifDescr is the name of the interface and ifAlias is the description we give interfaces on our configuration of the device. My goal is to create a graph panel which has only interfaces containing “WAN” in the ifAlias.
My configuration is this:
I have two variables in the dashboard -
First variable is named Network_Device and is configured as show tag values with key = "hostname"
(this comes from also getting the device name in the snmp collection process)
Second variable is named Interface and is set as follows:
show tag values from interface64 with key = "ifAlias" where hostname =~ /($Network_Device)/
with Regex /.*WAN.*/
In the “preview of values” section I see the list of ifAlias’s containing only “WAN” which is perfect. On my dashboard these show up beautifully as filter dropdowns. I see the correct devices + interface aliases that I want.
In my query on the panel itself I have the following:
SELECT non_negative_derivative(max("ifHCInOctets"), 1s) *8 AS "Traffic In", non_negative_derivative(max("ifHCOutOctets"), 1s) *8 AS "Traffic Out" FROM "interface64" WHERE ("hostname" =~ /^$Network_Device$/ AND "ifAlias" =~ /^$Interface$/) AND $timeFilter GROUP BY time($__interval), "hostname", "ifAlias" fill(null)
This is where the issue begins, it returns no data. Now if I remove the tag filter ifAlias =~ /^$Interface$/
it displays every single interface with the interface aliases, so I know the actual tagging part is working in influx and I know the data is there. It seems to be a specific issue with using ifAlias as a tag filter in the query but I am completely lost as to why.
Any assistance would be greatly appreciated.
Thanks