Community discussions

MikroTik App
 
helisat
just joined
Topic Author
Posts: 5
Joined: Thu Nov 20, 2008 4:26 am

API + PHP

Mon Dec 08, 2008 12:59 am

Hello,

I am trying to retrieve information about all wireless connections:

$API->write('/interface/wireless/registration-table/getall');

This command only returns the mac-address, ap, wds, comments. If you run the same command in terminal, more information is returned:

/interface wireless registration-table> pr
# INTERFACE RADIO-NAME MAC-ADDRESS AP SIGNAL-STRENGTH TX-RATE UPTIME


Is it possible to get all this information from the API? (most importantly the signal-strength)

Best Regards,
Luke
 
chronos
newbie
Posts: 32
Joined: Tue Aug 05, 2008 3:54 pm

Re: API + PHP

Wed Dec 10, 2008 9:21 pm

There is not only PHP API interface but direct SSH command execution from PHP too.
Refer to wiki:
http://wiki.mikrotik.com/wiki/Use_SSH_t ... key_login)
and
http://wiki.mikrotik.com/wiki/Traffic-flow

Example command:
[admin@mikrotik] /interface wireless registration-table> /interface wireless registration-table {:foreach i in=[find] do={:put ("signal-strenght=".[get $i signal-strength]." radio-name=".[get $i radio-name]." tx-rate=".[get $i tx-rate]);}}
signal-strenght=-60dBm@6Mbps radio-name=001D0FB0EE4D tx-rate=48Mbps
signal-strenght=-65dBm@6Mbps radio-name=001D0FB0ECE4 tx-rate=36Mbps
signal-strenght=-58dBm@6Mbps radio-name=0019E08B7D35 tx-rate=54Mbps
signal-strenght=-74dBm@6Mbps radio-name=000B6BDAFFF7 tx-rate=48Mbps

Output si very well suited for parsing via PHP explode function.

And you can get much more informations:
802.1x-port-enabled client-tx-limit frames hw-frames p-throughput rx-ccq tx-frames-timed-out
ack-timeout comment framing-current-size interface packed-bytes rx-rate tx-rate
ap compression framing-limit last-activity packed-frames signal-strength tx-signal-strength
ap-tx-limit distance framing-mode last-ip packets signal-to-noise uptime
authentication-type encryption group-encryption mac-address radio-name strength-at-rates wds
bytes frame-bytes hw-frame-bytes nstreme routeros-version tx-ccq wmm-enabled
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: API + PHP

Thu Dec 11, 2008 9:18 am

Hello,
I am trying to retrieve information about all wireless connections:
$API->write('/interface/wireless/registration-table/getall');
$API->write('/interface/wireless/registration-table/print');
 
matmor
just joined
Posts: 20
Joined: Wed Jan 07, 2009 5:09 pm
Location: Quebec, Canada

Re: API + PHP

Wed Jan 07, 2009 5:13 pm

With the php API you can also to that
 $API->write('/interface/wireless/registration-table/print',false);
 $API->write('=stats=');
I use it to output All info of eatch registered client for our support team !

It output many more thing that only the print command !!

I put info on the wiki

http://wiki.mikrotik.com/wiki/API_PHP_class

Who is online

Users browsing this forum: No registered users and 7 guests