06-28-2017 08:22 AM
Hi there, here a share a little script to sync UCRM and MIkrotik
Script to sync UCRM services with Mikrotik Queues. Searching in queues in Mikrotik by UCRM Ip Address Associated.
This Script is intended to replace de Mikrotik "queue type" values due i work with pcq queue types, but is easly to modify to just edit queue "max-limit" instead.
Actually V 1.0 designed by me, i'm php noob but this script works fine.
UCRM connect script copied from UBNT-Ondra on https://community.ubnt.com/t5/UCRM-Complete-WISP-Management/UCRM-API-example-script-to-reset-invoice...
Feel free to edit & improve this script, only one requirement, after improved upload and share it
It's posted in GitHub
Hope it is usefull for you
09-15-2017 02:39 PM
Script is a PHP based Script. you can load it in any Hosting with PHP support, or any own apache server.
For example i have a second docker on my same UCRM machine, where i have an apache server running.
You have to modify this script to addapt your system (IP - Credentials - ETC) and load it.
Any other cuestion let me know.
05-04-2018 08:22 PM
Hi, I tried it. I can see the router shows the user logged in via api, but no queues are added. I also get the error above.
router : RB1110ahX2
routeros : 6.42.1
server : ubuntu 16.04 ( apache2, php 7.0)
05-07-2018 05:48 AM
Hi @mymanga, actually the Script is not verifing if the queue already exists, it search de queue by IP address and modify it.
While not verifing, it also us not adding new queues.
Fell free to modify and update te script for your convenience.
Actually i'm thinking to convert this script in a plugin so we can add it in new UCRM versions.
05-07-2018 10:11 AM
05-07-2018 02:45 PM
I manually added a simple queue. The script just ignores it, it doesn't update it or anything..all it does is login and logout. Wondering if I'm missing something. Does this script actually do anything other than read UCRM data and echo it. I'm not seeing any functionality.
05-07-2018 02:59 PM
Then script reads such ip, compare it with all queues in mikrotik and updates the Simple Queue that match with such ip....
05-08-2018 04:22 AM
I noticed if there's a queue with the clients ip address , the script just says "client successfully updated" without throwing any errors. I manually added the simple queues with different upload and download speeds from those on UCRM.....the script ran without making any change. So I'm wondering what I'm I supposed to do get this running like you
05-30-2018 01:40 PM
Hi to all, sorry for the delay in the answer...
i was not working until last week, today i finished the development of a ñew PLUGIN, so you can use it with the new UCRM 2.10+...
This plugin compares the Customer Service IP Address with the simple queue ip address in Mikrotik, and sync to it the UCRM Bandwith in Queue Simple Max-Limit.
Please find it here: https://github.com/fgampel/UCRM-plugins/tree/master/plugins/mkt-queue-sync
test it, and tell me if it's working for you.
Please note, that this plugin is not completly mine, it's based on a ubiquiti FIO_CZ plugin and modified to work for Mikrotik Sync, so i'm not the fully developer of the plugin, i just made the arrangment for Mikrotik Conection and sync.
Please test it, and let me know if it works for you.... If you want to improve this php plugin, you're welcome.
Have a nice day.
10-19-2018 03:15 PM
its not working link of download, i tried with https://github.com/Ubiquiti-App/UCRM-plugins/tree/master/plugins/mkt-queue-sync but it doesnt do any change on mikrotik simple queue although it connects via api,
[2018-10-19 21:58:01.911070] [notice] Successful connection
[2018-10-19 21:58:02.134166] [notice] Synchronization correctly ended / Sincronizado Correctamente
10-19-2018 03:30 PM
Hi @percanta, github version is outdated one.... i already ask UBNT people to commit mi fork with new updates.
But, please use this link to download the new version, it's working fine: https://drive.google.com/open?id=1rrKAodKft1S9DxZq-0gibPgoLSOMuPTM
Let me know anything else.
10-22-2018 02:29 AM
as soon as the minor fix is done, the PR can be merged. Thanks.
03-12-2019 02:25 PM
@fgampel this plugin seems to heave evolved since it was first released. Does it still require a seperate host for the php script, or is it all done from within ucrm?
Also, does the plugin read the speed package from in ucrm? Where is that set?