unpoller / unifi

Go Library (w/ structures) to grab data from a Ubitquiti UniFi Controller
https://golift.io/discord
MIT License
114 stars 22 forks source link

Uncomment lines 255 to 338 in uap.go #68

Open cpunt opened 1 year ago

cpunt commented 1 year ago

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!

davidnewhall commented 1 year ago

Did you test this requested change already?

cpunt commented 1 year ago

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?

davidnewhall commented 1 year ago

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

cpunt commented 1 year ago

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

davidnewhall commented 1 year ago

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.

cpunt commented 1 year ago

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?