unifi icon indicating copy to clipboard operation
unifi copied to clipboard

Uncomment lines 255 to 338 in uap.go

Open cpunt opened this issue 2 years ago • 6 comments

Hey,

I currently use this library to gather telemetry from my unifi controller. I want to get aggregated wifi stats per radio but it appears that they have been commented out because they can be found in the VAP tables (uap.go lines 255 - 338). Is there anyway these can be uncommented since the aggregation of stats is useful? Also are the VAP tables the stats per radio and per ssid?

Thanks!

cpunt avatar Jan 03 '23 16:01 cpunt

Did you test this requested change already?

davidnewhall avatar Jan 03 '23 18:01 davidnewhall

So I have uncommented the code and tested this. I've run some tests and it appears Wifi0RxBytes + Wifi1RxBytes is equal to RxBytes in the Ap struct (which is expected and the breakdown I wanted). But when adding up the VapTables RxBytes for an Ap, the RxBytes does not equal the RxBytes in the Ap (Which I didn't expect). I'm trying to understand what data the VapTables actually contains. Do you know what the VapTables are?

cpunt avatar Jan 04 '23 17:01 cpunt

Unfortunately the API is not documented and it's all guess work. I think VapTables is the wireless networks.

davidnewhall avatar Jan 04 '23 18:01 davidnewhall

Thanks for the help. Can we uncomment uap.go lines 255 - 338? As this is what I need. I'm happy to make a pr or for you to commit

cpunt avatar Jan 05 '23 12:01 cpunt

I seem to have left a comment that those data bits exist elsewhere. I don't have a problem with uncommenting that section, but we need to make sure unpoller doesn't automatically start throwing that new data into a time series database.

davidnewhall avatar Jan 05 '23 16:01 davidnewhall

Okay, I'm keen to use this Unifi library for our project but haven't used the Unpoller library at all. How would we go about making sure this change doesn't automatically start throwing new data into the time series database? How does Unpoller select the data to insert?

cpunt avatar Jan 06 '23 14:01 cpunt