Jekyll2020-10-09T12:20:42-07:00/bensonk.netBenson's place for putting random stuff that might be useful to someoneUnifi Poller Setup2020-10-09T11:40:08-07:002020-10-09T11:40:08-07:00/networking/2020/10/09/welcome-to-jekyll<p>Unifi-poller is a tool to extract metrics from the Unifi network control plane,
store them in a timeseries database like prometheus’ tsdb, and provide
meaningful dashboards. We’ll set it up on a debian machine using prometheus.</p>
<p>One interesting note is that all of this works great for me on a raspberry pi 3
model B. It’s pretty awesome to live in a world where such an inexpensive, low
power device can run this kind of awesome stuff. The Raspberry Pi OS
distribution of Debian works great with these instructions.</p>
<ul>
<li>Add necessary keys
<ul>
<li><code class="highlighter-rouge">wget -q -O - https://golift.io/gpgkey | sudo apt-key add -</code></li>
<li><code class="highlighter-rouge">wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -</code></li>
</ul>
</li>
<li>Add debian package repositories
<ul>
<li><code class="highlighter-rouge">echo deb https://dl.bintray.com/golift/ubuntu bionic main | sudo tee /etc/apt/sources.list.d/golift.list</code></li>
<li><code class="highlighter-rouge">echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list</code></li>
</ul>
</li>
<li>Install packages
<ul>
<li><code class="highlighter-rouge">sudo apt-get update</code></li>
<li><code class="highlighter-rouge">sudo apt-get install prometheus grafana unifi-poller</code></li>
</ul>
</li>
<li>Edit config files
<ul>
<li><code class="highlighter-rouge">vim /etc/prometheus/prometheus.yml</code>
<ul>
<li>Add in the snippet from <a href="https://github.com/unifi-poller/unifi-poller/wiki/Prometheus#single-controller">this section</a>
of the unifi-poller prometheus docs</li>
</ul>
</li>
<li><code class="highlighter-rouge">vim /etc/unifi-poller/up.conf</code>
<ul>
<li>Create a readonly account for unifi poller in your unifi dashboard</li>
<li>Take a peek at the <a href="https://github.com/unifi-poller/unifi-poller/wiki/Configuration">instructions</a></li>
<li>Add your dashboard’s URL, username, and password to <code class="highlighter-rouge">up.conf</code></li>
<li>Enable prometheus</li>
</ul>
</li>
</ul>
</li>
<li><code class="highlighter-rouge">grafana-server</code>, <code class="highlighter-rouge">unifi-poller</code>, and <code class="highlighter-rouge">prometheus</code> are all configured to start on boot
<ul>
<li>Last time I did this, only grafana needed work: <code class="highlighter-rouge">sudo systemctl enable grafana-server.service</code></li>
</ul>
</li>
</ul>Unifi-poller is a tool to extract metrics from the Unifi network control plane, store them in a timeseries database like prometheus’ tsdb, and provide meaningful dashboards. We’ll set it up on a debian machine using prometheus.