Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] WAN Failover Status In InfluxDB #424

Open
ircmaxell opened this issue Aug 30, 2022 · 0 comments
Open

[Feature Request] WAN Failover Status In InfluxDB #424

ircmaxell opened this issue Aug 30, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ircmaxell
Copy link

ircmaxell commented Aug 30, 2022

I have recently setup multiple WAN support on my UDM-Pro. Currently, the only data that I have in InfluxDB through Unpoller is the basic infor for each wan port (name, IP, MAC, up status, enabled status, bytes, speed, rx/tx info), but nothing about the active uplink.

I can view fallback status via unifi_alarm table, but that leaves some to be desired:

Gateway[<--snip-->:a6] WAN iface eth9 transition to state failover
Gateway[<--snip-->:a6] WAN iface eth8 transition to state active
Gateway[<--snip-->:a6] WAN iface eth9 transition to state active
Gateway[<--snip-->:a6] WAN iface eth8 transition to state inactive

To enable this, I'd suggest one of three (or perhaps 2/all 3) options:

  1. Adding an "is_uplink" flag to the usg_wan_ports table to allow filtering / displaying that info
  2. Adding a new table usg_uplinks which has the information for the active uplink (including IP address and name of the active uplink, uplink source, etc)
  3. Adding a field to usg to identify which wan port is active: uplink, uplink_wan, etc.

Running unifi-poller -j devices shows that the data is present.

    "wan1": {
       "uplink_ifname": "eth8",
       "max_speed": 1000,
       "type": "ethernet",
       "autoneg": true,
       "enable": true,
       "flowctrl_rx": false,
       "flowctrl_tx": false,
       "full_duplex": true,
       "is_uplink": true,
       "mac": "<--snip-->:ae",
       "mac_table": [
         {
           "age": 116361,
           "authorized": true,
           "hostname": "<--snip-->",
           "ip": "<--snip-->.1",
           "lastReachable": 20,
           "mac": "<--snip-->:d8"
         }
       ],
       "media": "GE",
       "name": "eth8",
       "num_port": 1,
       "port_idx": 9,
       "port_poe": false,
       "rx_broadcast": 0,
       "rx_bytes": 401960855639,
       "rx_dropped": 0,
       "rx_errors": 0,
       "rx_multicast": 0,
       "rx_packets": 330381935,
       "rx_rate": 17638422,
       "rx_rate-max": 20141410,
       "speed": 1000,
       "speed_caps": 1048623,
       "tx_broadcast": 0,
       "tx_bytes": 83155981573,
       "tx_dropped": 0,
       "tx_errors": 0,
       "tx_multicast": 0,
       "tx_packets": 139164025,
       "tx_rate": 86231,
       "tx_rate-max": 1124109,
       "up": true,
       "ifname": "eth8",
       "tx_bytes-r": 10778,
       "rx_bytes-r": 2204802,
       "bytes-r": 2215580,
       "ip": "<--snip-->.45",
       "netmask": "255.255.255.0",
       "dns": [
         "10.1.0.10",
         "10.1.0.11"
       ]
     },
     "wan2": {
       "uplink_ifname": "eth9",
       "max_speed": 1000,
       "type": "ethernet",
       "autoneg": true,
       "enable": true,
       "flowctrl_rx": false,
       "flowctrl_tx": false,
       "full_duplex": true,
       "is_uplink": false,
       "mac": "<--snip-->:af",
       "mac_table": [
         {
           "age": 512280,
           "authorized": true,
           "hostname": "?",
           "ip": "<--snip-->.1",
           "lastReachable": 68,
           "mac": "<--snip-->:7c"
         }
       ],
      "media": "SFP+",
       "name": "eth9",
       "num_port": 1,
       "port_idx": 10,
       "port_poe": false,
       "rx_broadcast": 0,
       "rx_bytes": 34913005,
       "rx_dropped": 0,
       "rx_errors": 0,
       "rx_multicast": 0,
       "rx_packets": 621580,
       "rx_rate": 366,
       "rx_rate-max": 2953,
       "sfp_found": true,
       "sfp_part": "<--snip-->",
       "sfp_serial": "<--snip-->",
       "sfp_vendor": "TP-Link",
       "speed": 1000,
       "speed_caps": 1048864,
       "tx_broadcast": 0,
       "tx_bytes": 32169199,
       "tx_dropped": 0,
       "tx_errors": 0,
       "tx_multicast": 0,
       "tx_packets": 599783,
       "tx_rate": 366,
       "tx_rate-max": 2878,
       "up": true,
       "ifname": "eth9",
       "tx_bytes-r": 45,
       "rx_bytes-r": 45,
       "bytes-r": 90,
       "ip": "<--snip-->.243",
       "netmask": "255.255.255.0",
       "dns": [
         "10.1.0.10",
         "10.1.0.11"
       ]
     },
     "uplink": {
       "drops": 3,
       "ip": "<--snip-->.45",
       "latency": 2,
       "name": "eth8",
       "nameservers": [
         "10.1.0.10",
         "10.1.0.11"
       ],
       "netmask": "255.255.255.0",
       "num_port": 1,
       "rx_bytes": 401995768644,
       "rx_dropped": 0,
       "rx_errors": 0,
       "rx_multicast": 0,
       "rx_packets": 331003515,
       "speedtest_lastrun": 1661848193,
       "speedtest_ping": 3,
       "speedtest_status": "Success",
       "tx_bytes": 83188150772,
       "tx_dropped": 0,
       "tx_errors": 0,
       "tx_packets": 139763808,
       "up": true,
       "uptime": 500470,
       "xput_down": 906.813,
       "xput_up": 923.246,
       "port_idx": 9,
       "media": "GE",
       "speed": 1000,
       "full_duplex": true,
       "rx_rate": 17638422,
       "tx_rate": 86231,
       "max_speed": 1000,
       "type": "wire",
       "tx_bytes-r": 10824,
       "rx_bytes-r": 2204848,
       "uplink_source": "legacy",
       "bytes-r": 2215672
     },
     "last_wan_ip": "<--snip-->.45",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants