See the Updating wiki for upgrade details.
Important: You need to create an Influx database, or setup Prometheus, and user/pass on the UniFi Controller. You also need Grafana and you have to add the Influx or Prometheus data source to Grafana. Do not skip any of the pre-reqs!
Click here to reveal the prerequisites for poller.
- Add a user to the UniFi Controller. After logging into your controller:
- Go to
Settings -> Admins
- Add a read-only user (
unifipoller
) with a nice long password. - The new user needs access to each site. For each UniFi Site you want to poll, add admin via the 'Invite existing admin' option.
- Take note of this info, you need to put it into the unifi-poller config file in a moment.
- Go to
- You need InfluxDB OR You need Prometheus.
- If you already have one of these, skip ahead to Grafana.
- Using Docker? You can use the docker-compose file file to setup Poller, InfluxDB and Grafana all at once.
- If using Influx, Create a database in InfluxDB. Something like:
Take note of the username and password you create (if you choose to do so, you may skip the last 2 commands). You'll need the hostname, port, database name, and optionally user/pass in a moment for the unifi-poller config file.
influx -host localhost -port 8086 CREATE DATABASE unifi USE unifi CREATE USER unifipoller WITH PASSWORD 'unifipoller' WITH ALL PRIVILEGES GRANT ALL ON unifi TO unifipoller
- If you're using Prometheus, see the Prometheus doc for post-install configuration.
- You need Grafana.
After you follow the directions in Grafana Wiki, and before (or after) you install unifi-poller:
- Add a new data source
for the InfluxDB
unifi
database you created. - Or, if you use Prometheus, add a Prometheus data source.
- Do not forget to add the data source! It's generally just a URL, very easy.
- Add a new data source
for the InfluxDB
- Check that you meet the pre-reqs above, or use Docker Compose to "do it all."
- See the Docker wiki for information about installing poller.
- Then see the Configuration doc for post-install configuration information.
- Synology? Check out the Synology HOWTO provided by @Scyto.
Poller is now available in the ports tree and can be installed from there.
Follow these directions to install poller using FreeBSD ports.
- To install compiled binary from ports run:
pkg install net/unifi-poller
- To build and install from ports run:
cd /usr/ports/net-mgmt/unifi-poller
make install clean
- Use these commands to maintain the service:
# View manual.
man unifi-poller
# Edit config file.
# A defualt configuration file is placed in /usr/local/etc/unifi-poller/up.conf which is not overwritten on upgrades
# A sample configuration is placed in /usr/local/etc/unifi-poller/up.conf.sample
vi /usr/local/etc/unifi-poller/up.conf
# enable the service. Or edit /etc/rc.conf
sysrc unifi_poller_enable="YES"
# Start, Restart, Stop service.
service unifi-poller start
service unifi-poller restart
service unifi-poller stop
# Check service status, useful for scripts.
service unifi-poller status
# Logs should wind up in this file, but your syslog may differ.
grep unifi-poller /var/log/messages
JFrog Bintray provides package hosting with RedHat, CentOS, Debian and Ubuntu repos.
Follow these directions to configure the repo and install poller.
The same package is in all the repos, but you can set the name to match your OS as shown below.
- Create a file at
/etc/yum.repos.d/golift.repo
with the following contents. - You may replace
centos
withel
, but they're the same thing either way.[golift] name=Go Lift Awesomeness - Main Repo baseurl=https://dl.bintray.com/golift/centos/main/$basearch/ gpgcheck=1 repo_gpgcheck=1 enabled=1 sslverify=1 gpgkey=https://golift.io/gpgkey
- Then install the package:
sudo yum install unifi-poller
- You'll have to respond
yes
to the prompts to install the Go Lift GPG key.
- Install the repo and package using the commands below.
- Replace
ubuntu
withdebian
if you have Debian.curl -s https://golift.io/gpgkey | sudo apt-key add - echo deb https://dl.bintray.com/golift/ubuntu bionic main | sudo tee /etc/apt/sources.list.d/golift.list sudo apt update sudo apt install unifi-poller
- Supported distributions:
xenial
,bionic
,focal
,jesse
,stretch
,buster
,bullseye
- If you have another distro, try one of these ^ (they're all the same).
See the Configuration doc and the example config file for additional post-install configuration information.
-
Edit the config file after installing the package, and correct the authentication information for your setup:
sudo nano /etc/unifi-poller/up.conf # or sudo vi /etc/unifi-poller/up.conf
-
Restart the service:
sudo systemctl restart unifi-poller
-
Check the log:
tail -f -n100 /var/log/syslog /var/log/messages | grep unifi-poller
Follow these instructions to install poller using Homebrew.
- Install Homebrew
brew install golift/mugs/unifi-poller
- Edit the config file after installing the brew:
nano /usr/local/etc/unifi-poller/up.conf # or vi /usr/local/etc/unifi-poller/up.conf
- Correct the authentication information for your setup (see prerequisites).
- Start the service:
# do not use sudo brew services start unifi-poller
- The log file should show up at
/usr/local/var/log/unifi-poller.log
. - If it does not show up, make sure your user has permissions to create the file.
- The log file should show up at
- This is how you restart it. Do this when you upgrade.:
brew services restart unifi-poller
You can build your own package from source with the Makefile.
Recommend reading the note at the bottom if you're using a mac.
- Install FPM
- Install Go.
- Clone this repo and change your working directory to the checkout.
git clone https://github.com/unifi-poller/unifi-poller.git cd unifi-poller
- Install local Golang dependencies:
- Build a package (or two!):
make deb
will build a Debian package.make rpm
builds a RHEL package.
- Install it:
sudo dpkg -i *.deb || sudo rpm -Uvh *.rpm
If you're building linux packages on a mac you can run brew install rpmbuild gnu-tar
to get the additional tools you need. That means you're going to need Homebrew.
And if you're going to install Homebrew, or already have, you can simply do something
like this to get your Go environment up and build the packages:
brew install rpmbuild gnu-tar go dep
sudo gem install --no-document fpm
mkdir ~/go/{src,mod}
export GOPATH=~/go
cd ~go/src
git clone https://github.com/unifi-poller/unifi-poller.git
cd unifi-poller
make rpm deb