18. 03. 2019 Alessandro Romboli Unified Monitoring

Monitoring a Ubiquity Unifi Wireless Controller

Scenario

Unifi is a well-known wireless solution developed by Ubiquity Networks.  It’s widely used due to its efficiency and low cost.

Up until some years ago, the vendor offered just a basic set of access points managed by a software controller.  Year after year, the number and types of wireless controllers grew to include many specialized types (internal, external, long range, wide coverage, etc.)The software controller has become much more sophisticated and can now control not just Wireless Access Points, but also Security Gateways, LAN Switches and Cameras. The controller collects a lot of interesting information and metrics in its local MongoDB: this data can be accessed via web console.

Centralized Monitoring

With a centralized monitoring solution like NetEye, it would be great to integrate the metrics collected by the Unifi Network Controller.

One nice project is available on GitHub: davidnewhall/unifi-poller: it’s an agent which collects your Unifi client and device data and send it to InfluxDB.  This way, the metrics can be duplicated in NetEye’s InfluxDB, available to build up any Grafana dashboard you can imagine.

How To

To build a unifi-poller agent into NetEye, several steps are required.

Detailed instructions for building code on NetEye 4 are available on GitHub:

https://github.com/zampat/neteye4/tree/master/monitoring/monitoring-plugins/wireless

First of all, the project has to be cloned locally:

git clone https://github.com/davidnewhall/unifi-poller

Next, a working Google Go complier is required:

https://golang.org/doc/install

From within Go, four additional Libraries must be installed:

go get github.com/golift/unifi

go get github.com/influxdata/influxdb1-client/v2

go get github.com/naoina/toml

go get github.com/ogier/pflag

At this point you can change to the unifi-poller local path, and a simple make command will build the executable.

I advise you to keep the default paths for unify-poller components:

  • Agent configuration file:  /usr/local/etc/unifi-poller/up.conf
  • The Agent as /usr/local/bin/unifi-poller

The configuration file is self-explanatory:  you need to configure the access URL and credentials for the Unifi Network Controller, the polling period and the Influx Database name (the name unifiis recommended).

The project doesn’t provide an initdaemon startup script for the unifi-poller: however, I’ve attached an example one to this blog.

The last step before starting the unifi-poller daemon is to create a brand-new influx Database!

Within NetEye, create the new Influx database with proper data retention:

CREATE DATABASE unifi WITH DURATION 90d

Now you can start the daemon.  If everything is OK, it will log some basic statistics in /var/log/unifi-poller.log:

[INFO] Logged Unifi States. Clients: 80 – Wireless APs: 9 Gateways: 0 Switches: 3

Presenting Data with Grafana

The unifi-poller project provides a few Grafana dashboards that can be directly imported into NetEye.

Of course, the Dashboards can be customized and integrated with metrics coming from other systems.

Here is the basic Insights dashboard:

And a deeper wireless analysis:

Also, here is wireless channel distribution, divided by Vendor:

A lot of metrics are collected.  I urge you to take a deeper look at InfluxDB to find the most interesting ones.

Alessandro Romboli

Alessandro Romboli

Site Reliability Engineer at Würth Phoenix
My name is Alessandro and I joined Würth-Phoenix early in 2013. I have over 20 years of experience in the IT sector: For a long time I've worked for a big Italian bank in a very complex environment, managing the software provisioning for all the branch offices. Then I've worked as a system administrator for an international IT provider supporting several big companies in their infrastructures, providing high availability solutions and disaster recovery implementations. I've joined the VMware virtual infrastructure in early stage, since version 2: it was one of the first productive Server Farms in Italy. I always like to study and compare different technologies: I work with Linux, MAC OSX, Windows and VMWare. Since I joined Würth Phoenix, I could also expand my experience on Firewalls, Storage Area Networks, Local Area Networks, designing and implementing complete solutions for our customers. Primarily, I'm a system administrator and solution designer, certified as VMware VCP6 DCV, Microsoft MCP for Windows Server, Hyper-V and System Center Virtual Machine Manager, SQL Server, SharePoint. Besides computers, I also like photography, sport and trekking in the mountains.

Author

Alessandro Romboli

My name is Alessandro and I joined Würth-Phoenix early in 2013. I have over 20 years of experience in the IT sector: For a long time I've worked for a big Italian bank in a very complex environment, managing the software provisioning for all the branch offices. Then I've worked as a system administrator for an international IT provider supporting several big companies in their infrastructures, providing high availability solutions and disaster recovery implementations. I've joined the VMware virtual infrastructure in early stage, since version 2: it was one of the first productive Server Farms in Italy. I always like to study and compare different technologies: I work with Linux, MAC OSX, Windows and VMWare. Since I joined Würth Phoenix, I could also expand my experience on Firewalls, Storage Area Networks, Local Area Networks, designing and implementing complete solutions for our customers. Primarily, I'm a system administrator and solution designer, certified as VMware VCP6 DCV, Microsoft MCP for Windows Server, Hyper-V and System Center Virtual Machine Manager, SQL Server, SharePoint. Besides computers, I also like photography, sport and trekking in the mountains.

One Reply to “Monitoring a Ubiquity Unifi Wireless Controller”

  1. Nice article! You can install unifi-poller with Travis-CI built binary packages on Linux now. A deb and an rpm package are available on the GitHub Releases page and should work on any Debian or RHEL distro. This should make it a lot easier to get up and going. If you’re running a mac, a home-brew formula is available for you. And if none of that suits your fancy, check out the Docker image available on Docker Cloud. https://github.com/davidnewhall/unifi-poller/wiki/Docker

    Have a wonderful day!

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive