As you can tell from the last few posts, I’ve been having a lot of fun with collectd and instrumenting my systems. But I had one glaring hole until recently: my Ubiquti Unifi AP access points. Well no longer!
I came across an NPM package that could easily extract data from the Unifi controller software. From there, it was trivially easy to implement a script that harvests data from the controller and passes is along to collectd.
Thus, collectd-unifi was born.
Getting started with it is pretty easy. Just clone the repo, install the NPM
dependencies and edit the config file. Once you have the script working, you
can use the Exec
plugin in collectd to run the script:
LoadPlugin exec
<Plugin "exec">
Interval 60
Exec "daemon:daemon" "/usr/bin/nodejs" "/opt/collectd-unifi/unifi.js"
</Plugin>
Restart collectd and you should now have Unifi data flowing.