0

Access UCRM Database

by Jim Bouse 7. February 2022 10:36

We use Ubiquiti's CRM for billing in our company.

We needed to access the database to extract a bit of information not included in the API.

I figured out how to do this.

HERE IS A PDF Access UCRM Database.pdf (87.15 kb)

Let me start with:

THIS IS A VERY DANGEROUS THING TO DO.  DO NOT DO THIS UNLESS YOU ARE COMPLETELY COMFORTABLE WITH DATABASE ACCESS AND POSSIBLY LOSING YOUR DATA!

Now that the warning is out of the way, here we go.

  1. Install Apache2: sudo apt install apache2 <-- this will throw an error.  We will fix this in the next 2 steps
  2. Change Apache2 port number in: sudo nano /etc/apache2/ports.conf
  3. Start Apache2: sudo service apache2 start
  4. Install the public key for the pgAdmin4 repository (if not done previously): sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
  5. Create the repository configuration file: sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
  6. Install pgAdmin4: sudo apt install pgadmin4-web 
  7. Configure the webserver: sudo /usr/pgadmin4/bin/setup-web.sh
  8. Add IP address restriction to pgAdmin4 directory for an extra layer of security
    1. sudo nano /etc/apache2/conf-enabled/pgadmin4.conf
    2. Change "Require all granted" to "Require ip your.office.ip.here"
  9. Restart Apache2: sudo service apache2 restart
  10. Get UCRM postgres DB IP and password:
    1. container=`sudo docker ps | grep postgres | awk '{print $1;}'`; sudo docker inspect "$container" | grep '"IPAddress": "172\|UCRM_POSTGRES_PASSWORD'
    2. sudo docker ps
    3. sudo docker inspect ID xxxxx  <---- WHERE xxxxx is the ID of the docker referencing postgres
    4. Look towards top for UCRM DB password
    5. Look towards bottom for docker IP
  11. Open web browser to: http://ucrm.ip.address.here:customPort/pgadmin4
  12. Create new "Server"
    1. Give it a name: "UCRM"
    2. On the Connection tab:
      1. Hostname: The IP from Step 10.3
      2. Username: ucrm
      3. Password: The password from Step 10.2
      4. Save Password: yes.
  13. If all goes correctly, you should have direct DB access to the database
  14. DO NOT SCREW UP YOUR DATABASE!  I WARNED YOU!

  15. Have fun.

Tags:

Ubiquiti | UCRM | WISP

0

Make UBNT device use a single polarity.

by Jim Bouse 16. December 2013 11:36

FYI in /tmp/system.cfg (configuration file):

radio.1.txchainmask=[bit mask]
radio.1.rxchainmask=[bit mask]

Where bit mask means which chain/chains to enable:

1(0bit) - chain0

2(1bit) - chain1

4(2bit) - chain2

So you can make combinations like 1 and 4 = 5, means chain0 and chain2 enabled. And so on.

NOTE: Chains are HW specif, not all have all chains or the same chains.

I guess my sample will help to make live easier and avoid custom scripts to be installed.

 

Lifted from: http://community.ubnt.com/t5/Installation-Troubleshooting/iwpriv-to-make-2x2-devices-work-like-1x1/m-p/657119/highlight/true#M57052

Tags:

Ubiquiti | WISP

0

AC1 to AC2 GPS Coordinate Pusher

by Jim Bouse 13. August 2013 16:37

Ok... Since it looks like UBNT isn't excited about pulling data from AC1 into AC2, I whipped up a python script that copies the GPS coordinates from AC1 to the device so that it can be used in AC2.

WARNING!!!: THIS MAY BREAK YOUR NETWORK.

Don't say I didn't warn you.

That said, I have run it against my network and it just caused breif outages while devices rebooted.

# 
# AC1 -> AC2 Coordinate Pusher 1.0
# Jim Bouse
# 8/13/2013
# jim@mobileitpro.com
#
# This script runs on Python 3.3.2 on Windows.
# I have not tested against any other OS or version
# This script may destroy your network.
# This script may destroy your network.
# This script may destroy your network.
# I really mean it.  If this script blows your network up, 
# I'm sorry but I did warn you.
# 
# The purpose of this script is to query AirControl v1 and populate
# the coordinates from AC1 into the config file in the devices.
# When the coordinates are in the config file, AirControl v2 properly
# places the device after discovery.
# 
# NOTE: <------ READ THIS !!!
# This script reboots the devices after the file change.
# This means you will lose connection and it will be a problem if you # do it during a busy time.
# GOOD NEWS is that it only does it on the devices that need it.
# BAD NEWS is that it will have to be run a few times to get all the
# devices in your org,
# because if it reboots an AP, the clients will not be able to be
# connected to until the next pass.
#
#
# Instructions: Place this script and plink into the same directory.
# Open a command prompt and CD to the directory.
# Run this file.
#
 

AC1-to-AC2-Coordinate-Pusher.py.txt (3.64 kb)

Tags:

AirControl | Python | Ubiquiti | WISP

0

AirOS 5.5.2 for UniFi

by Jim Bouse 3. December 2012 13:41

From time to time, I install UniFi access points for customers.  These customers normally do not need a controller and just want a nice looking AP.  NVX from the UBNT forums put together the firmware needed to convert the UniFi to a standard UBNT radio.

Here is the original post: http://forum.ubnt.com/showpost.php?p=389380

I have mirrored the files here: AirOS 5.5.2 for UniFi.zip (10.65 mb)

Tags:

Ubiquiti | WISP

0

Low Cost Outdoor UPS

by Jim Bouse 30. July 2012 16:24

I own a small WISP and need an UPS in a small enclosure at the bottom of my towers to provide temporary power for when the grid drops for a few minutes/hours.

This is often coupled with a multi-port POE injector from Wifi-Soft and a router for a WISP tower location.

This comes to $387 for an outdoor UPS with a run time of about 8 hours without power for 2 - 8 watt radios and a RouterBoard.

Here is a similar version of what I have described.



Tags: , , , , ,

Mikrotik | Ubiquiti | WISP

0

Capture full resolution snapshot from UBNT AirCam with PHP and FFMPEG

by Jim Bouse 16. May 2012 08:42
<?php
system("ffmpeg -i rtsp://username:password@10.0.0.1/live/ch00_0 -y -f image2 -sameq -t 0.001 /path/to/warehouse.jpg");

header( "Content-type: image/jpeg" );
@readfile("/path/to/warehouse.jpg");
?>

Originally posted: http://forum.ubnt.com/showpost.php?p=299673&postcount=1

Tags:

Ubiquiti

0

Reset UBNT Device to Default via SSH

by Jim Bouse 28. March 2012 11:28

NOTICE! This resets it to default (factory).  If you want to just reboot, use "reboot".

cp /usr/etc/system.cfg /tmp/system.cfg; save; reboot

Tags:

Ubiquiti

Powered by BlogEngine.NET 2.5.0.6
Original Design by Laptop Geek, Adapted by onesoft