HostiFi / export-unifi-devices-to-csv

Export UniFi devices to CSV
GNU General Public License v3.0
28 stars 8 forks source link

Doesn't work on UDM Pro 1.12.22 #2

Open winnall opened 2 years ago

winnall commented 2 years ago

I tried following the instructions in README.md on my UDM Pro 1.12.22 but I kept running into errors:

# wget https://raw.githubusercontent.com/HostiFi/Export-UniFi-Devices-to-CSV/main/unifi_devices_to_csv.py
wget: not an http or ftp url: https://raw.githubusercontent.com/HostiFi/Export-UniFi-Devices-to-CSV/main/unifi_devices_to_csv.py

# wget http://raw.githubusercontent.com/HostiFi/Export-UniFi-Devices-to-CSV/main/unifi_devices_to_csv.py
Connecting to raw.githubusercontent.com (185.199.108.133:80)
wget: not an http or ftp url: https://raw.githubusercontent.com/HostiFi/Export-UniFi-Devices-to-CSV/main/unifi_devices_to_csv.py

So I cut-and-pasted the source into a file called list.py and tried to execute it:

# python3 list.py
Traceback (most recent call last):
  File "list.py", line 2, in <module>
    from pymongo import MongoClient
ModuleNotFoundError: No module named 'pymongo'

I then tried to install pymongo:

# python3 -m pip install pymongo
/usr/bin/python3: No module named pip

# python3 -m pip3 install pymongo
/usr/bin/python3: No module named pip3

Any hints on how to proceed? I'm not really at home with Python...

Steve

Shayano commented 1 year ago

Hi Steve, I hope you've found a way to do this in the last few months.

I had a similar problem with an installation on Debian 10. 7.2.95 (Build: atag_7.2.95_18699) I don't know if this applies to Unifi-OS but maybe it will help you

You have to start by installing pip for python3 apt install python3-pip

Then install the specific pymongo version 3.12 pip3 install pymongo==3.12 or python3 -m pip install pymongo==3.12

Then you should be able to run the script.

winnall commented 1 year ago

@Shayano Thanks., I’ve only just seen your comment. I solved the problem by using a program which scraped the UniFi app’s web page and generated CSV from that.