Hi!
I try to send login cmomand usgin API. I use C++.
First i send /login command. I send ASCII code (6) + “/login” + ASCII code(0). Server return the response:
!done
=ret=xxxxxxxxxxxxxxx
And now.. i don’t know how i send the command:
/login
=name=admin
=response=xxxxxxxxxxxxxxxxxxxxxxx
md5 digest should be made of “\x00”, password and ret (in this order). And note that ret should be converted to binary string by taking every two characters as hexadecimal representing one byte.
It does not look that your conversion if result to hexadecimal is correct. result1 has a lot of 3Fs (that corresponds to ?), but none of ‘?’ is in your original result.
Hiz forum!
now i can connect to mikrotik using api (no python).
My question now is..
What kind of commands are aviable in beta5?
getall,listen,remove,more? (enable?disable?)
if i send command: /interface/vlan/remove
=name=vlan1
not work, i recive: argument error
You should use getall to get all interfaces like “/interface/vlan/getall” (see
API doc on wiki). You should provide values returned in =.id, to =numbers
like this =numbers=*1. Next versions will require to pass it in =.id
parameter.
I.e. you should send command: /interface/vlan/remove
=numbers=*1
You can print ids in console using command “:put [/interface vlan find]”.
Hi,
now i send command /interface/vlan/getall
and recive parametres of vlan1. vlan1 have *5 id
if i send /interface/vlan/remove
=numbers=*5
i not recive nothing, the socket waiting for response from the server (mikrotik)
Using the python example on the wiki I am successful at making a connection and submitting a few commands. However, the example of /user/active/listen just hangs the connection - waiting for a response from RouterOS. It seems many commands just hang there … does beta6 work with the example in the wiki ?
Also, does the listen command similiar to the ‘monitor’ command?
Can you give me an example of how to monitor tx/rx bytes on an ethernet interface using the API? Would it be /interface/monitor=0/listen or something ?