Forum Discussion

Kevin_Ford's avatar
Kevin_Ford
Icon for Advisor rankAdvisor
2 years ago

New Ubiquiti Modules

Having recently switched my home network from a hodgepodge of APs, switches & an Untangle firewall to all Ubiquiti gear, I wanted to bring more of the data I was seeing in the UniFi web console to LogicMonitor. The core Ubiquiti modules are a good starting point but there's room to grow.

Those using Ubiquiti networking gear may know that monitoring their equipment can be a challenge. Ubiquiti makes SNMP available for their access points (APs), switches, and older equipment but not for their UniFi controllers, which can be particularly frustrating for users of their Dream systems like their popular Dream Machine (UDM) Pro that function as a controller, router/firewall, and other systems such as VOIP and camera NVR. Ubiquiti has a robust REST API for their UniFi controllers but it's undocumented.

I started digging more into those APIs, watching what calls were made when clicking on various parts of the local UniFi web console and building modules that provide much greater visibility including new metrics, alert & event logs (requires LM Inspector, formerly referred to as LM Logs), topology, properties & more. These are now available in LM Exchange as the "Ubiquiti UniFi" package. I'm also attaching a new dashboard that leverages these new modules.

NOTE: Unlike the core modules, the ones I'm providing here are just community-supported at this time. These have been tested against a UDM Pro, a UDR, a UniFi Switch, and various UniFi APs but I'm sure there's still room for improvement. If you make useful modifications please post them here for everyone's benefit! Also note that these are currently coded to monitor via local controllers, not the UniFi cloud portal.

Some of these modules expand upon the core modules, in which case I've appended "_extended" to the name. All these newer modules will appear under an "Ubiquiti" group, whereas the original core versions are ungrouped. If you're satisfied with the data coming from those extended versions you can disable the core versions if you'd like to avoid redundant polling.

New modules in the "Ubiquiti UniFi" package...

  • Datasources:
    • Ubiquiti_UniFi_AccessPoints_extended: tracks many new metrics such as "satisfaction" scores plus added discovery of more AP properties.
    • Ubiquiti_UniFi_Alerts_LMLogs: (requires LM Inspector) ingests UniFi alerts into LM Inspector via the UniFi API.
    • Ubiquiti_UniFi_Clients_Wired_extended: better identification of clients, including IP.
    • Ubiquiti_UniFi_Clients_Wireless_extended: much better identification of clients, including IP; plus tracking of “satisfaction” scores.
    • Ubiquiti_UniFi_Events_LMLogs: (requires LM Inspector) ingests UniFi events into LM Inspector via the UniFi API.
    • Ubiquiti_UniFi_Sites_extended: better device classification.
    • Ubiquiti_UniFi_Switches_extended: added better device classification plus tracking of "satisfaction" scores.
    • Ubiquiti_UniFi_UDM: monitors metrics from Ubiquiti Dream Machines (UDMs)/UDM Pros and other UniFi controllers.
    • Ubiquiti_UniFi_UDM_DPI: monitors traffic by high-level deep-packet inspection (DPI) categories.
    • Ubiquiti_UniFi_UDM_Ports: monitors traffic & status of individual switch ports on UDMs and other UniFi hardware controllers.
    • Ubiquiti_UniFi_UDM_Storage: discovers & monitors capacity of filesystems on UDMs and other UniFi hardware controllers.
  • PropertySources:
    • addCategory_Ubiquiti_UniFi_UDM: adds several new properties for UDMs and other UniFi hardware controllers, including ERIs for topology.
  • TopologySources:
    • Ubiquiti_UniFi_Wireless: creates topology maps for clients & managed devices. NOTE: this replaces the core version. The name is a bit of a misnomer as this version also maps wired clients.
  • ConfigSources:
    • Ubiquiti_UniFi_Configs: (experimental) grabs the latest config from your UniFi controller. Note: Unlike the other modules in the package, this will require the UniFi user have admin privileges.

To enable...

1. Install the package into your portal by clicking the Exchange tab in the left-hand nav-bar and...

  1. a. clicking the Public Repository tab,
  2. b. ensuring "Community" is enabled in the Status filter (I recommend leaving the 'Expand Packages' toggle off to simplify searching),
  3. c. searching for "ubiquiti" and installing the "Ubiquiti UniFi" package.

  1. 2. If you're not already monitoring your local UniFi controller (including UDMs, UDRs, etc.) then follow the instructions in this support article: https://www.logicmonitor.com/support/ubiquiti-unifi-network-monitoring

Once installed you'll see the new modules appear under your UniFi controller(s) in the "Ubiquiti" group to distinguish them from the core modules.

If you'd like to install a dashboard that leverages many of these new modules, you can download it here. Once downloaded, in your portal go to Dashboards, expand the dashboard list and click Add > From File.

 

Some examples of what's new...

  • Zoomed view of the new dashboard mentioned above...

     
  • Additional info about managed devices & connected clients...

     
  • System metrics for a UDM Pro...

     
  • Some deep packet inspection (DPI) metrics of various high-level traffic categories from a UDM Pro...

     
  • Capture of "satisfaction" scores...

     
  • Topology mapping (in this case, controller to switches to APs & clients)...

     
  • Example event logs being ingested via API...

5 Replies

  • @JaredM A couple of weeks ago I was finally able to spend a few hours digging into Ubiquiti’s latest updates. Ubiquiti’s always been a challenge since their APIs are undocumented & unsupported, so I and many others in the community simply do our best to reverse-engineer them & to keep up with their changes. I really wish they’d publish an official API, or at least support SNMP on their UDMs & controllers.

    The bright side is that, yes, I was able to get my community modules working with 3.2.7 on my UDM Pro and verified they work in a couple of other environments. You can find them in LM Exchange by searching for the “Ubiquiti UniFi” package published by “lmkevinford” (lowercase L at the beginning).

    I also added caching of site data between polls, re-use of logins per polling cycle, better retry logic to get around the API’s new rate limits, and a few other improvements.

  • hi @Kevin Ford, since the release of UniFi OS 3.2.7 have you found success in returning data from network devices? We’ve lost connectivity through the official LM modules, and I’m interested to hear if you’ve had a different experience with your modules?

  • @Kevin Ford I’m wondering if you would be willing to share what you found on your devices with the 3.2.7 version? I’m still seeing the initial login post work successfully but the following get calls are returning 401 Unauthorized. We have a few Cloud Keys that are running 3.2.7 that we are testing against.

    Thanks!

  • @Kevin Ford I want to let you know another engineer I work with got your modules working. Adding the explicit URL in the unifi.url property helped.

  • thanks, that makes me more hopeful! We don’t have any Dream Machines, but cloud keys and software-based controllers. So far I don’t have any instances returned on your modules I just tested, but I’ll keep trying.