Unifi AP Export
-
Does Any one know of a easy way to get a list of all AP's and their IP address from a unifi controller?
Or care to give me a tutorial on how if not simple
-
@hobbit666 said in Unifi AP Export:
Does Any one know of a easy way to get a list of all AP's and their IP address from a unifi controller?
Or care to give me a tutorial on how if not simple
Login, open Devices on the left. Make sure All is selected up top.
-
@travisdh1 I believed @hobbit666 was looking to get a spreadsheet of AP's from a controller.
-
@DustinB3403 said in Unifi AP Export:
@travisdh1 I believed @hobbit666 was looking to get a spreadsheet of AP's from a controller.
Correct, i need to create a CSV file of all the APs with their IP address to import into Zabbix
@travisdh1 That only show the AP's for one site. Sorry should of mentioned "all" from "all" sites
-
I just tried changing to List view and copy the page and past in Excel - the IP's didn't come with it.. weird and suck.
-
@hobbit666 said in Unifi AP Export:
Does Any one know of a easy way to get a list of all AP's and their IP address from a unifi controller?
Or care to give me a tutorial on how if not simple
You are going to need to use an api client most likely to get the info out, https://github.com/Art-of-WiFi/
Unifi-Api-Browser: https://unificontrol.readthedocs.io/en/latest/index.html
Unifi-Api-Client: https://github.com/Art-of-WiFi/UniFi-API-client
You can use the Api Browser which is a php site to get your json list of all the devices and then parse it yourself into a csv, or use the client directly to get the values you want.I also use https://unificontrol.readthedocs.io/en/latest/index.html which is a python3 version based on the work of hte Unifi-Api-Client above listed, and just get the values I want with it.
This just getting the list of devices from the default site, but you could go through all your sites and get all devices
import ssl import unificontrol client = unificontrol.UnifiClient(host="UNIFI_CONTROLLER",username="UNIFI_CONTROLLER_USERNAME",password="UNIFI_CONTROLLER_PASSWORD",site="default",cert=cert) devices = client.list_devices() for i in range(len(devices)): ... print ("Name,IP") ... print (devices[i].get('name') + "," + devices[i].get('ip')) ... # Results Name,IP G&G Main Room,10.10.10.101 >>>
-
Community effort, but you can also find the several api endpoints directly from https://ubntwiki.com/products/software/unifi-controller/api, if you dont want to use any sort of client and just want the json directly.
List all your sites /api/self/sites List all devices from a specific site /api/s/SITE_NAME/stat/device
-
@Romo
Thanks will give that a go if i get time this afternoon -
@Romo said in Unifi AP Export:
@hobbit666 said in Unifi AP Export:
I also use https://unificontrol.readthedocs.io/en/latest/index.html which is a python3 version based on the work of hte Unifi-Api-Client above listed, and just get the values I want with it.
This just getting the list of devices from the default site, but you could go through all your sites and get all devices
import ssl import unificontrol client = unificontrol.UnifiClient(host="UNIFI_CONTROLLER",username="UNIFI_CONTROLLER_USERNAME",password="UNIFI_CONTROLLER_PASSWORD",site="default",cert=cert) devices = client.list_devices() for i in range(len(devices)): ... print ("Name,IP") ... print (devices[i].get('name') + "," + devices[i].get('ip')) ... # Results Name,IP G&G Main Room,10.10.10.101 >>>
What OS are you using for your controller. Having a few issues with mine Debian GNU/Linux 10 install
-
@hobbit666 You mean issues talking about the whole controller or using the api clients? The api clients where not meant to be used directly in the controller.
My personale controller is still on Debian 9, and my desktop is Kubuntu 20.04, this is where I connected from using unificontrol
-
@Romo said in Unifi AP Export:
@hobbit666 You mean issues talking about the whole controller or using the api clients? The api clients where not meant to be used directly in the controller.
My personale controller is still on Debian 9, and my desktop is Kubuntu 20.04, this is where I connected from using unificontrol
Think this is where i was getting confused i was trying to run it from the controller itself. I'll try again tomorrow.