Ubiquiti Cloud Gateway Ultra (UCG-Ultra) Bandwidth Monitoring

And the same version has been released for the UDR, so now I (at last) have SNMP on it!

UniFi OS - Dream Router 4.0.6 | Ubiquiti Community

So… anyone managed to pull WAN In and WAN Out stats with the new OS 4.0.6 on Cloud Gateway Ultra?

The setup I had for my old USG3 did not work (1.3.6.1.2.1.31.1.1.1.6.2 / 1.3.6.1.2.1.31.1.1.1.10.2). Also tried my luck with a MIB Browser but was not able to figure the correct value out :frowning: .

In my case, the WAN port is eth4. This is on a UDR. I simply monitored and graphed each eth port while doing a speed test.

YMMV

  - platform: snmp
    name: snmp_wan_in
    host: 192.168.0.1
    community: !secret router_snmp_community
    version: 2c
    baseoid: 1.3.6.1.2.1.2.2.1.10.13  # ifInOctets.13 / eth4 (interface 12, zero-indexed)
    unit_of_measurement: octets

  - platform: snmp
    name: snmp_wan_out
    host: 192.168.0.1
    community: !secret router_snmp_community
    version: 2c
    baseoid: 1.3.6.1.2.1.2.2.1.16.13  # ifOutOctets.13 / eth4 (interface 12, zero-indexed)
    unit_of_measurement: octets

Mapping:


Unifi Dream Router
OS version is: 10.16.0

Info About the Router:
Description: Linux Dream-Router 4.4.198-ui-mtk #1 SMP PREEMPT Fri Jun 7 23:26:01 CST 2024 aarch64
Name: Dream-Router
Uptime: 4 days 17:39:37
interface #0 name is: lo
interface #1 name is: dummy0
interface #2 name is: nic0
interface #3 name is: gre0
interface #4 name is: gretap0
interface #5 name is: ip_vti0
interface #6 name is: sit0
interface #7 name is: ip6tnl0
interface #8 name is: eth0
interface #9 name is: eth1
interface #10 name is: eth2
interface #11 name is: eth3
interface #12 name is: eth4
interface #13 name is: deprecated
interface #14 name is: ppd
interface #15 name is: MEDIATEK Corp. Device 7915
interface #16 name is: MEDIATEK Corp. Device 7622
interface #17 name is: ifb0
interface #18 name is: ifb1
interface #19 name is: switch0
interface #20 name is: MEDIATEK Corp. Device 7622
interface #21 name is: MEDIATEK Corp. Device 7622
interface #22 name is: MEDIATEK Corp. Device 7622
interface #23 name is: MEDIATEK Corp. Device 7622
interface #24 name is: MEDIATEK Corp. Device 7622
interface #25 name is: MEDIATEK Corp. Device 7622
interface #26 name is: MEDIATEK Corp. Device 7622
interface #27 name is: wds0
interface #28 name is: wds1
interface #29 name is: wds2
Number of interfaces reported by the router: 30

You can maybe find the MiB file on your device, which may be more descriptive. I didn’t check in my case. I kind of forgot about that option.

2 Likes

Thanks, this was very educational. These seem to be the interface names for my UCG-Ultra.

So it appears the correct baseoid’s are 1.3.6.1.2.1.2.2.1.10.4 and 1.3.6.1.2.1.2.2.1.16.4 respectively.

henrikb@WS-D21XD14:~$ snmpbulkwalk -v 2c -c public 192.168.1.1 1.3.6.1.2.1.31.1.1.1.1
iso.3.6.1.2.1.31.1.1.1.1.1 = STRING: “lo”
iso.3.6.1.2.1.31.1.1.1.1.2 = STRING: “dummy0”
iso.3.6.1.2.1.31.1.1.1.1.3 = STRING: “miireg”
iso.3.6.1.2.1.31.1.1.1.1.4 = STRING: “eth4”
iso.3.6.1.2.1.31.1.1.1.1.5 = STRING: “switch0”
iso.3.6.1.2.1.31.1.1.1.1.6 = STRING: “ifb0”
iso.3.6.1.2.1.31.1.1.1.1.7 = STRING: “ifb1”
iso.3.6.1.2.1.31.1.1.1.1.8 = STRING: “eth0”
iso.3.6.1.2.1.31.1.1.1.1.9 = STRING: “eth1”
iso.3.6.1.2.1.31.1.1.1.1.10 = STRING: “eth2”
iso.3.6.1.2.1.31.1.1.1.1.11 = STRING: “eth3”
iso.3.6.1.2.1.31.1.1.1.1.12 = STRING: “switch0.1”
iso.3.6.1.2.1.31.1.1.1.1.13 = STRING: “switch0.10”
iso.3.6.1.2.1.31.1.1.1.1.14 = STRING: “br0”
iso.3.6.1.2.1.31.1.1.1.1.15 = STRING: “br10”

1 Like

Maybe! I’m glad it helps so far. :slight_smile:

In my case, I first thought it might be nic0, but it’s unclear what it refers to. I assumed NIC, as in Network Interface Card, and perhaps being a physical interface.

Then I thought it might be eth0, but it seems the vertically placed ethernet ports on my UDR is numbered from the bottom up, and the WAN port is at the top, so that’s how I ended up with eth4 and confirmed it with my testing.

I will compare a full day’s download and upload totals after today with my ISP’s report to ensure this is correct, but so far, it’s looking good.

Sure. I am pretty confident that eth4 is the right one for UCG Ultra, if you look at the ports on the Controller application it shows up as port #5, which makes eth4 given that in SNMP the first port is eth0. It also seems to correspond at what is shown on the Unifi dashboard.

image

1 Like

Ah, well-spotted.

I forgot about that view in the console.

It’s the same for me.

Thanks for sharing, do you have full config like real time bandwidth monitoring?

Check these:

And my current version:

2 Likes

I do have a UCG Ultra and still search for an option to see the current network speed that is been displayed within the UCG perfectly. Did anybody came across an option to configure this or receive it correctly?

Thanks

Have you upgraded your software since July 2024? That version added SNMP support.

https://community.ui.com/releases/UniFi-OS-Cloud-Gateways-4-0-6/6dfaa8b2-eb9b-4e85-899a-fc04af7d15b7

I do can confirm that my devices are up to date to the latest versions. So you suggest using SMTP rather then the Unifi application itself?

It looked like you were responding to my post, and I’m using SNMP.

(SMTP is an email protocol.)

1 Like

I tried your suggested OID objects on my UCG-Ultra but it seems to be not the correct OID for the WAN Port. You might have suggestions to find the correct one?

Cheers

Hi - I have a Unifi Cloud Gateway, and have set up the Integration with full network privileges. I want to be able to monitor bandwidth, however the instructions I read say the setting to enable this is on page 3 of configuration, but after hitting submit I am not getting a page 2 or 3, I just get “Success - options successfully saved” Apologies if I am missing something simple here - appreciate if someone can point me the right way.

How did you monitored this? I’m on a macOS device and there is not really a good MIB browser with live capturing

The tool I used before seems to have been compromised and since it’s a network-related tool, alternative downloads might contain malware. I’m not going to mention the tool’s name. The vendor’s website seems hacked and abandoned. There doesn’t seem readibly (and reliable) free MIB browsers with charting abilities. You could always try a free trial.

A simple alternative is to use any SNMP walk utility (command line will do) to take a snapshot of the OIDs for specific network interfaces before and after running a speed test.

As a first choice, you can pretty accurately establish which ethernet port (OID) to pick before running the speed test.

Figured out my answer by checking the code - you need home assistant advanced mode switched on to see the multi page configuration options including enabling bandwidth sensors.

I already had been in Advanced Mode but where not able to see a multi page config.