Unify Long Range`i lisamine Cacti monitooringusse

I whipped up a little script to day in PHP to be used with Cacti and making use of the UNIFI API to grab the number of connections on an AP or on the entire SSID. It also grabs the average RSSI and graphs it as well.

To use this script you have to have JSON installed into PHP.
Here is a link for how to on linux

You must unzip the file and put the PHP file in your scripts folder.
On my linux box it was /var/www/cacti/scripts/.

Then Import the template. It will create a Data Template and a Graph Template.

Create a device as normal. Then go to “Create Graphs for this Host”. Under Graph templates hit the drop down and choose “Unifi Info”, click Create.
This will open a new screen asking for a few inputs.
IP: ip of the controller
Username: username to login to the Unifi controller
Password: password to login to the Unifi controller
APmac_or_SSID: The AP’s MAC that you want to graph or you can put the SSID you want to graph. Also replace the |APmac_or_SSID| with this value in the Title of the graph and the Name of the datasource. (Could not figure out how to make it do it automatically)

Then watch your graphs.

I had a few ask to be able to get traffic statistics for the APs. Currently the API does not give you any data on specific APs. Hopefully the upcoming version of the Unifi Firmware will give us real SNMP monitoring capabilities soon.