Community discussions

MUM Europe 2020

Search found 52 matches

by Christiano
Mon Dec 20, 2010 7:11 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

I can when i replace the user´s name: Before (don´t function in old version): $comando = '/user set password='.$new_password.' manut; /system scheduler remove '.$tarefa; After (work fine in old and new version): $comando = '/user set manut password='.$new_password; /system scheduler remove '.$tarefa...
by Christiano
Mon Dec 20, 2010 7:02 pm
Forum: Beginner Basics
Topic: ROS 3.22 problem with API PHP on RB433
Replies: 4
Views: 1163

Re: ROS 3.22 problem with API PHP on RB433

This: $comando = '/user set password='.$new_password.' manut'; don´t function. But this: $comando = '/user set manut password='.$new_password; work fine! I test these in winbox terminal and in API PHP. Transfer position user´s name help me here. I don´t know if is the best way but work and i didn´t ...
by Christiano
Tue Dec 14, 2010 2:04 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Hello, I`m trying PHP API with test router - v3.23 API service enabled. I wanna add test user on test router, but without success. $API = new routeros_api(); $API->debug = true; if ($API->connect('10.11.10.11', 'user', 'pass')) { $API->write('/user add group=full name=test22 password=test123', fals...
by Christiano
Tue Dec 14, 2010 12:52 pm
Forum: Beginner Basics
Topic: How to remove all scheduler tasks in terminal?
Replies: 6
Views: 3439

Re: How to remove all scheduler tasks in terminal?

Thx Chupaka to confirm. Is glad to see you again.
by Christiano
Tue Dec 14, 2010 12:34 pm
Forum: Beginner Basics
Topic: ROS 3.22 problem with API PHP on RB433
Replies: 4
Views: 1163

Re: ROS 3.22 problem with API PHP on RB433

I ask this because i can´t see an answer for this in this forum (search) and in the documentation i have "This is PHP class for working with RouterOS v3 API". Well, i´m a beginner and i don´t understand why ROS 3.22 don´t create a task in scheduller...
by Christiano
Mon Dec 13, 2010 10:01 pm
Forum: Beginner Basics
Topic: ROS 3.22 problem with API PHP on RB433
Replies: 4
Views: 1163

Re: ROS 3.22 problem with API PHP on RB433

Sorry this is my error in 'ctrl + c' and 'ctrl + v'. $new_password = 654321; The complet line: $comando = '/user set password='.$new_password.' manut; /system scheduler remove '.$tarefa; The code don´t create a task in scheduller. But this occur in version 3.22 and not in 4.5. :( Any idea? This is a...
by Christiano
Mon Dec 13, 2010 9:28 pm
Forum: Beginner Basics
Topic: ROS 3.22 problem with API PHP on RB433
Replies: 4
Views: 1163

ROS 3.22 problem with API PHP on RB433

Hello community!!! This code don´t work and i don´t know why: $dt_mikrotik = 'Aug/26/2011'; $hr_form_final = '17:00:00'; $interval = '00:01:00'; $tarefa2 = 'test'; $generic_password = 123456; $interval = '00:01:00'; $politica = 'read,write,policy'; $comando = '/user set password='.$generic_password....
by Christiano
Wed Dec 08, 2010 8:57 pm
Forum: Scripting
Topic: API - ACL Control
Replies: 37
Views: 17425

Re: API - ACL Control

can you please write the complete code?

I think you want this:

http://forum.mikrotik.com/viewtopic.php?f=13&t=47274

Here you see what do you put in <your_id_here>. Perhapes you need a list of id. So look this link...
by Christiano
Wed Dec 08, 2010 8:51 pm
Forum: Beginner Basics
Topic: How to remove all scheduler tasks in terminal?
Replies: 6
Views: 3439

Re: How to remove all scheduler tasks in terminal?

I don´t know if the best way, but work: $API->write('/system/scheduler/print', false); $API->write('=.proplist=.id'); $tarefas = $API->read(); foreach ($tarefas as $tarefa): $API->write('/system/scheduler/remove', false); $API->write('=.id='.$tarefa['.id']); $API->read(); endforeach; Thx all communi...
by Christiano
Wed Dec 08, 2010 2:10 pm
Forum: Beginner Basics
Topic: How to remove all scheduler tasks in terminal?
Replies: 6
Views: 3439

Re: How to remove all scheduler tasks in terminal?

Hello again Fewi! And with API? I try this but don´t work: $API->write('/system/scheduler/remove/[/system/scheduler/find]'); $API->read(); Result: Connection attempt #1 to 111.111.111.111:1111... <<< [6] /login >>> [5/5 bytes read. >>> [5, 39] !done >>> [37/37 bytes read. >>> [37, 1] =ret=8e70ec07dc...
by Christiano
Tue Dec 07, 2010 10:11 pm
Forum: Beginner Basics
Topic: How to remove all scheduler tasks in terminal?
Replies: 6
Views: 3439

Re: How to remove all scheduler tasks in terminal?

Thx a lot fewe. It´s work fine. Thx. Very goog help. :D
by Christiano
Tue Dec 07, 2010 9:39 pm
Forum: Beginner Basics
Topic: How to remove all scheduler tasks in terminal?
Replies: 6
Views: 3439

How to remove all scheduler tasks in terminal?

Hi community,

Someone knows how to remove all tasks with cli comand?

I try all these in terminal:

1) /system scheduler remove all
2) /system scheduler remove *
3) /system scheduler remove numbers="all"
4) /system scheduler remove

But they don´t work. :( Someonw help?

Thx for any help...
by Christiano
Tue Nov 23, 2010 10:19 pm
Forum: Beginner Basics
Topic: How to blocking access to scheduler for specific group?
Replies: 1
Views: 517

How to blocking access to scheduler for specific group?

Hi community!

I need blocking access to scheduler for a specific group, but this group use 'read' in their configuration. It is possible?

Thx for any help.
by Christiano
Mon Sep 13, 2010 9:29 pm
Forum: Scripting
Topic: PHP API bug - read() fails on large replies - this fix OK?
Replies: 22
Views: 6659

Re: PHP API bug - read() fails on large replies - this fix O

NAB, thank you for posting this script. I had to make one modification to it as I was getting the following error: PHP Notice: Undefined variable: receiveddone in routeros_api.class.php on line 322 I had to add an else statement so that the var was valid: // If we get a !done, make a note of it. if...
by Christiano
Mon Sep 13, 2010 5:51 pm
Forum: Scripting
Topic: PHP API bug - read() fails on large replies - this fix OK?
Replies: 22
Views: 6659

Re: PHP API bug - read() fails on large replies - this fix O

Solution for listen command Make new method called listen and comment those two lines, and it will work if ($_ == "!done") $receiveddone=true; Pawel Cieplinski But if you do this, here it don´t work: if ( (!$this->connected && !$STATUS['unread_bytes']) || ($this->connected && !$STATUS['unread_bytes...
by Christiano
Mon Sep 13, 2010 5:34 pm
Forum: Scripting
Topic: API PHP class
Replies: 45
Views: 61746

Re: API PHP class

Well i see this http://forum.mikrotik.com/viewtopic.php ... HP#p147918

and for me it´s work very well.

I do not declare to say that this is the problem or the solution, just it worked for me.

:)
by Christiano
Mon Sep 13, 2010 5:13 pm
Forum: Scripting
Topic: Random failure in connection with mikrotik using the PHP API
Replies: 7
Views: 5016

Re: Random failure in connection with mikrotik using the PHP

It was fixed when I followed the suggestion found here: http://forum.mikrotik.com/viewtopic.php?f=9&t=30358&p=147918&hilit=sleep+API+PHP#p147918 I can not tell if this is the problem, but it worked. The sleep before read() in connect() fixed the problem at the moment. For me, 2 seconds its cool. :o
by Christiano
Mon Sep 13, 2010 5:08 pm
Forum: Scripting
Topic: PHP API bug - read() fails on large replies - this fix OK?
Replies: 22
Views: 6659

Re: PHP API bug - read() fails on large replies - this fix O

Hi erazor999. I have problem with connection??? Sometimes connect, sometimes not!!! Connection attempt #1 to 10.2.2.7:8728... <<< [6] /login >>> [5/5 bytes read. >>> [5, 39] !done >>> [37/37 bytes read. >>> [37, 1] =ret=ce97ace24bd5dd4b4d451ca4ceddce40 Connection attempt #2 to 10.2.2.7:8728... <<< [...
by Christiano
Sat Sep 04, 2010 12:03 am
Forum: Scripting
Topic: API PHP class
Replies: 45
Views: 61746

Re: API PHP class

Hi community mikrotik, i´m from Brazil. I use API PHP but, on line, sometimes connect, sometimes not!!! In localhost everything is all right. I´m a newbe and look for any help. My code: <?php function gravarequipamento() { if($this->data['Equipamento']['form'] == 'gravarequipamento') { $this->data =...
by Christiano
Fri Sep 03, 2010 9:33 pm
Forum: Scripting
Topic: Random failure in connection with mikrotik using the PHP API
Replies: 7
Views: 5016

Re: Random failure in connection with mikrotik using the PHP

I'm using the PHP API and Winbox to support the tests.

What command should I use in terminal of winbox to activate the sniff? I´m looking for it in the terminal but i´m newbe... :?

I see in window bar of winbox v4.5 RB433. I think is the version, no?
by Christiano
Fri Sep 03, 2010 8:26 pm
Forum: Scripting
Topic: Random failure in connection with mikrotik using the PHP API
Replies: 7
Views: 5016

Re: Random failure in connection with mikrotik using the PHP

Hi Chupaka, Glad to see you again. When i try to conect to execute add or remov comand with API PHP i receive this: Connection attempt #1 to xxx.xxx.xxx.xxx:8728... <<< [6] /login >>> [5/5 bytes read. >>> [5, 0] !trap Connection attempt #2 to xxx.xxx.xxx.xxx:8728... <<< [6] /login >>> [5/5 bytes rea...
by Christiano
Fri Sep 03, 2010 7:24 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Chupaka,

Do you know anything about it:

http://forum.mikrotik.com/viewtopic.php?f=9&t=44744

It´s on line. Please one idea, one light.

Thx.
by Christiano
Fri Sep 03, 2010 4:03 pm
Forum: Scripting
Topic: Random failure in connection with mikrotik using the PHP API
Replies: 7
Views: 5016

Random failure in connection with mikrotik using the PHP API

Hi community friends, I try to connect mikrotik with script below and i get success but in random situation: Sometimes connects, sometimes fails to connect. Has anyone gone through this experience (I'm using the PHP API)? The code: <?php function gravarequipamento() { if($this->data['Equipamento']['...
by Christiano
Fri Sep 03, 2010 3:31 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

You need see this first: http://wiki.mikrotik.com/wiki/Manual:API http://wiki.mikrotik.com/wiki/API_PHP_class http://under-linux.org/f215/mikrotik-api-php-mysql-134691/ http://under-linux.org/f143/ajuda-api-php-122996/ After go back here and read more in the fórum. Beleave, you can. Without charity ...
by Christiano
Mon Aug 30, 2010 8:30 pm
Forum: The User Manager
Topic: user manager session logs print or export
Replies: 2
Views: 2045

Re: user manager session logs print or export

Session Logs i don´t know but with the logs, in terminal of winBox: /system log print file=test.txt In winBox, go to menu files. In window 'Files list' you see the 'test.txt'. Click, drag and drop the desktop windows for example. I think is the same with session logs. Use tab key to autocomplet help...
by Christiano
Mon Aug 30, 2010 7:37 pm
Forum: Beginner Basics
Topic: How to add limit time in cli command '/user add' ?
Replies: 3
Views: 1425

Re: How to add limit time in cli command '/user add' ?

I don´t know exactly becuse i'm not a network administrator and frankly I know very little about it. I´m a novice programmer. After three months working in this company they asked me to build a system with web interface to control access to the mikrotik. I don´t knew anything about the mikrotik at t...
by Christiano
Fri Aug 27, 2010 10:02 pm
Forum: Beginner Basics
Topic: how to remove user after 30 days automaticlly?
Replies: 9
Views: 1626

Re: how to remove user after 30 days automaticlly?

pleas helpe me how to remove user's from the users list after 30 days automaticly after first use (firs time online ) >>

can do that or not ??

am use hotspot , mikrotik v.2.9.27

pleas helpe me ?

Look:

http://forum.mikrotik.com/viewtopic.php?f=13&t=44421
by Christiano
Fri Aug 27, 2010 10:00 pm
Forum: General
Topic: Hotspot users automatic expiry
Replies: 13
Views: 3721

Re: Hotspot users automatic expiry

Hello. I have been using the hotspot feature on the mikrotik router OS. I need to know if I can somehow create users to expire automatically, say after 12 hours or 1day. I would also like to know if there is a way of generating random logins and passwords, whereby when the user comes, he will sort ...
by Christiano
Fri Aug 27, 2010 9:54 pm
Forum: Beginner Basics
Topic: How to add limit time in cli command '/user add' ?
Replies: 3
Views: 1425

Re: How to add limit time in cli command '/user add' ?

Hello community, I suppose the answer is: $tarefa = 'testetask'; $dt = 'Aug/26/2010'; $hr = '18:09:00'; $hrint = '00:01:00'; $politica = 'read,write,policy'; $comando = '/user remove teste; /system scheduler remove '.$tarefa; $API->write('/system/scheduler/add', false); $API->write('=name='.$tarefa,...
by Christiano
Fri Aug 27, 2010 9:32 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Hello Chupaka, I´m here again, an. It´s good, no? I hope you're well. I prayed for you and your work ... Well, let´s go again: I asked in the link below about limit time for password when i create user. For example, after two hours the password lost and user need new access password. It´s possible?...
by Christiano
Mon Aug 23, 2010 5:51 pm
Forum: Beginner Basics
Topic: How to add limit time in cli command '/user add' ?
Replies: 3
Views: 1425

How to add limit time in cli command '/user add' ?

Hi community. I´m from brazil and apreciate any help for these beginners questions? Thank´s any help! (A) If a need add user with time limit of 3 hour " 03:00:00 ", how to add limit time in cli command '/user add' ? When i access with this user after 3 hour its can´t loggin. What is the command in t...
by Christiano
Wed Aug 18, 2010 10:27 pm
Forum: General
Topic: Hotspot users automatic expiry
Replies: 13
Views: 3721

Re: Hotspot users automatic expiry

Hello. I have been using the hotspot feature on the mikrotik router OS. I need to know if I can somehow create users to expire automatically, say after 12 hours or 1day. I would also like to know if there is a way of generating random logins and passwords, whereby when the user comes, he will sort ...
by Christiano
Wed Aug 18, 2010 9:43 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Hello Chupaka, I´m here again, an. It´s good, no? I hope you're well. I prayed for you and your work ... Well, let´s go again: I asked in the link below about limit time for password when i create user. For example, after two hours the password lost and user need new access password. It´s possible? ...
by Christiano
Wed Aug 18, 2010 9:28 pm
Forum: Beginner Basics
Topic: how to remove user after 30 days automaticlly?
Replies: 9
Views: 1626

Re: how to remove user after 30 days automaticlly?

Hi community,

I´m from Brazil and i want to know limit password by time when i created user. (command set in terminal)

For example: password have two hours validity. After this the user lasted the access.

It's possible?

What is the cli command?

Anybody help?
by Christiano
Tue Aug 17, 2010 4:18 pm
Forum: Scripting
Topic: how set user using php api
Replies: 5
Views: 3142

Re: how set user using php api

Chupaka answered here:

http://forum.mikrotik.com/viewtopic.php ... 37#p222837

Thx Chupaka.

Everybory, please, visit the link to see de result and the code at the end of post.
by Christiano
Tue Aug 17, 2010 4:16 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

Adapting the test above to add user: <?php require('routeros_api.class.php'); $API = new routeros_api(); $API->debug = true; $ip = 'xxx.xxx.xxx.xxx'; $old_password = '123456'; $old_name = 'testea'; $new_password = '123456'; $new_name = 'testeb'; if ($API->connect($ip, $old_name, $old_password)) { $...
by Christiano
Tue Aug 17, 2010 3:31 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Chupaka´s solution is here: http://forum.mikrotik.com/viewtopic.php ... 31#p222931

The code is working! Visit the link. Thx!
by Christiano
Tue Aug 17, 2010 3:29 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I'm afraid to celebrate at the wrong time but I think now you are right on target. :) Chupak you're the man! :D Now is working !!!!! Look: SCRIPT: <?php require('routeros_api.class.php'); $API = new routeros_api(); $API->debug = true; $ip = 'xxx.xxx.xxx.xxx'; $old_password = '123456'; $old_name = 't...
by Christiano
Tue Aug 17, 2010 2:32 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

Sorry. I know I am Brazilian and my English is not very good. But what is ninet says (i think) that the code did not work as I mentioned in another post. Soon we may conclude that the solution is not here. ninet Response: Thank you mrz for your reply, I got the point, however with your code I didn`t...
by Christiano
Mon Aug 16, 2010 11:50 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I replace 1 for id: $API->write('/user/set', false); $API->write('=.id='.$old_name, false); $API->write('=name='.$new_name); But didn´t work: Connection attempt #1 to 192.168.200.221:8728... <<< [6] /login >>> [5/5 bytes read. >>> [5, 39] !done >>> [37/37 bytes read. >>> [37, 1] =ret=1fb26a805b65541...
by Christiano
Mon Aug 16, 2010 11:27 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I'm going to abuse a little more of your patience ... I think I've done that in the previous code above. But I tried again. Look: [b]CODE:[/b] <?php require('routeros_api.class.php'); $API = new routeros_api(); $API->debug = true; $old_name = 'teste4'; $new_name = 'teste3'; if ($API->connect('xxx.xx...
by Christiano
Mon Aug 16, 2010 10:11 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

But here the solution is not with API PHP. It work with SSH and shell. Is another solution for the same problem.

The solution for add or set user with API PHP is not appear. Or i´m wrong?
by Christiano
Mon Aug 16, 2010 10:05 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I do not understand exactly what you want. Sorry! What should I do to run the script? Should I remove the false parameter? What I'm trying to do: -> I'm trying to connect the card using a mikrotik user manager; -> Then want to change the name of the user; -> Disconnect; -> I want to reconnect with t...
by Christiano
Mon Aug 16, 2010 9:26 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I changed the position of command and got an answer after you have indicated. But it did not work. Look: $API->write('/user/set',false); $API->write('=.1=teste4'); // Here a tried id, 0 and 1. $API->write('=name=teste3',false); That was it? This is the way it should write the code? the result: Conne...
by Christiano
Mon Aug 16, 2010 8:59 pm
Forum: Scripting
Topic: basic help with PHP API
Replies: 23
Views: 6263

Re: basic help with PHP API

I had the same problem but with the command set.

I think the PHP API is not working completely and would be great find more examples in the manual.

You see the same problems but with the command set in another post:
http://forum.mikrotik.com/viewtopic.php ... 98#p222798
by Christiano
Mon Aug 16, 2010 8:38 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

I need to replace the 'id', right? In terminal of winBox i use "/user active print" and the answer: # WHEN NAME ADDRESS VIA 0 jan/02/1970 00:00:34 teste4 0.0.0.0 winbox 1 jan/02/1970 00:00:34 teste4 0.0.0.0 console With this in hand I tried: Script: require('routeros_api.class.php'); $API = new rout...
by Christiano
Mon Aug 16, 2010 4:55 pm
Forum: Scripting
Topic: how set user using php api
Replies: 5
Views: 3142

Re: how set user using php api

Ok. I do that.

Thank you.
by Christiano
Mon Aug 16, 2010 4:50 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

In the terminal i use (winBox): /user set teste4 name=teste3 I want to do the same with api php but don´t work. I create one user with winBox called teste4. And now i try to use api php to set the name or password, for example, disconnect and connect again. But the set command in api php don´t work ...
by Christiano
Mon Aug 16, 2010 4:43 pm
Forum: Scripting
Topic: how set user using php api
Replies: 5
Views: 3142

Re: how set user using php api

Ok. Not my intent. If you know how to delete the first post, i prefer this here because it a independent post.

Thank you.
by Christiano
Mon Aug 16, 2010 4:32 pm
Forum: Scripting
Topic: how set user using php api
Replies: 5
Views: 3142

how set user using php api

Hello community! I´m from Brazil and my english is poor. Thank you for any help... I try this script below but it don´t work: require('routeros_api.class.php'); $API = new routeros_api(); $API->debug = true; // user test $ip = 'xxx.xxx.xxx.xxx'; $usuario = 'teste4'; // full same admin $senha = '1234...
by Christiano
Fri Aug 13, 2010 9:32 pm
Forum: Scripting
Topic: Change hotspot password with PHP API
Replies: 73
Views: 43450

Re: Change hotspot password with PHP API

Hi, I´m from Brazil and my english is poor. I need help to translate command CLI to API PHP. Anybody know? I intent do this: require('routeros_api.class.php'); $API = new routeros_api(); $API->debug = true; $ip = 'xxx.xxx.xxx.xxx'; $usuario = 'admin'; $senha = ''; if ($API->connect($ip, $usuario, $s...