VictorRobellini / pfSense-Dashboard

A functional and useful dashboard for pfSense that utilizes influxdb, grafana and telegraf
671 stars 187 forks source link

Gateways Grafana Tabs not working correctly when WAN has ipv4 and ipv6 enabled #37

Closed wrightsonm closed 3 years ago

wrightsonm commented 3 years ago

Following on from my posts here:

netgate forums

I have updated to the latest version in the github repo and then reapplied my changes to fix the gateways view.

When ipv4 and ipv6 are enabled on a single you need gateway_name as a primary key as otherwise the groupby interface doesn't work correctly as you have 2 gateways both with igb0 interface name.

I changed grafana to group by gateway_name instead of interface. This is basically reverting to the same behaviour as existed approx 1 month ago.

Not sure why there are so many changes having exported the json. perhaps i have a different version of grafana? Version of Grafana used when making the changes: Grafana v7.4.3 (010f20c1c8)

I only changed the gateway variable to: SHOW TAG VALUES FROM "gateways" WITH KEY = "gateway_name" WHERE "host" =~ /^$Host$/

Changed group by on Gateway RTT and Gateway Loss charts to gateway_name

Added gateway_name to Gateway Summary. Added interface to this list so both gateway_name and interface can be seen.

Changes to telegraf output can be observed below:

telegraf --test --config /usr/local/etc/telegraf.conf

before:

gateways,host=fw.anson.lan,interface=igb0 defaultgw=1,delay=0,gwdescr="Interface WAN_DHCP Gateway",loss=100,monitor="192.168.0.1",source="192.168.0.30",status="down",stddev=0,substatus="highloss" 1620242074000000000 gateways,host=fw.anson.lan,interface=igb0 defaultgw=0,delay=0,gwdescr="Interface WAN_DHCP6 Gateway",loss=0,monitor="",source="",status="",stddev=0,substatus="N/A" 1620242074000000000

The changes to the telegraf output can be seen below: telegraf --test --config /usr/local/etc/telegraf.conf

after:

gateways,gateway_name=WAN_DHCP,host=fw.anson.lan,interface=igb0 defaultgw=1,delay=0,gwdescr="Interface WAN_DHCP Gateway",loss=100,monitor="192.168.0.1",source="192.168.0.30",status="down",stddev=0,substatus="highloss" 1620242589000000000 gateways,gateway_name=WAN_DHCP6,host=fw.anson.lan,interface=igb0 defaultgw=0,delay=0,gwdescr="Interface WAN_DHCP6 Gateway",loss=0,monitor="",source="",status="",stddev=0,substatus="N/A" 1620242589000000000

VictorRobellini commented 3 years ago

Thank you for following up on this. I've got no IPv6 and using the gateway_name is much more logical.

Thanks for all the help