Repository navigation
fix(udm-wan-monitor): show the same WAN IP and IPv6 as UniFi Network - #15
Draft
lennard0711 wants to merge 2 commits into
Draft
lennard0711 wants to merge 2 commits into
lennard0711 wants to merge 2 commits into
Conversation
…UniFi WAN-Monitor, fix polling on current DOCSight Verified against a UCG Ultra (UDRULT, UniFi OS 5.1.33), including a real failover (WAN 1 unplugged and reconnected). - Derive WAN port names from the gateway's wan1/wan2 ifname instead of hardcoding the UDM Pro's eth9/eth8 (UCG Ultra: eth4/eth0), so it follows whichever ports are assigned as WAN, including reassigned LAN ports. Only wan1 and wan2 are considered; a WAN that is not configured produces no row. Dashboard cards show the real ifname. - Select the gateway by type (udm/ugw/usg/ucg) and presence of wan1; never fall back to devices[0], which could be a switch or AP and would report a bogus offline WAN. Fail with "No gateway device found" or "No WAN interface (wan1/wan2) found on gateway" instead. - Fix CollectorResult.ok()/failure() no longer existing in current DOCSight (every poll was recorded as a failure). Helpers use them only if present. - Reuse the collector's session for dashboard requests and only fall back to the legacy /api/login on 404/405. A login per request tripped UniFi OS' login rate limit (429), which was then masked as a 401. - Rename the module to "UniFi WAN-Monitor" (display name only; module id, directory, routes and event type are unchanged) and mention UCG in the texts. - Version 3.2.0.
- IP: show the WAN interface's own address, as UniFi Network does. Behind another router (double NAT) that is a private address, so the previous geo-detected public address looked wrong next to the UniFi dashboard. The public address stays available as ip_public and is shown in an extra "Public IP" row only when it differs from the interface IP. - IPv6: skip link-local (fe80::/10) addresses. UniFi lists them first, so an uplink without IPv6 showed a link-local address as if it had one. - Add label_ip_public translations (en, de, fr, es).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the UCG support PR (#14, 3.2.0) and bumps the module to 3.2.1. Please merge that one first; until then this PR also shows its commit.
Hi @Oggy512, this is a small follow-up from my UCG Ultra setup. If you have a UDM, it would be great if you could confirm the dashboard values look right there as well.
Summary
The WAN cards showed values that differ from what UniFi Network shows for the same WAN. Observed on a UCG Ultra whose WAN 2 sits behind another router (double NAT) and has no IPv6.
Changes
80.x.x.xwhile UniFi showed the private192.168.0.x. The public address is kept asip_publicand shown in an extra "Public IP" row only when it differs from the interface IP, so no information is lost. On a direct connection both are identical and the row stays hidden.fe80::/10) addresses. UniFi lists the interface's link-local address first, so an uplink without IPv6 displayed a link-local address as if it had IPv6.label_ip_publicadded to the en/de/fr/es translations.Event messages use the same IP, so they now name the interface address.
Testing
python3 -m unittest discover -s testsandscripts/validate_registry.pypass.