Community discussions

MikroTik App
 
User avatar
AmrSubZero
just joined
Topic Author
Posts: 17
Joined: Tue Dec 02, 2014 3:29 pm
Location: Egypt
Contact:

API get tx-rate/rx-rate of hotspot hosts in response using Pear2/RouterOS

Fri Apr 09, 2021 7:36 am

I'm using Pear2/RouterOS PHP Api Client

On RouterOS version: v6.47.1 (stable) on x86 (x86_64)

Trying to retrieve tx-rate / rx-rate of hotspot hosts

Here's my approach :

<?php
    $client = new RouterOS\Client("HOST", "USER", "PASSWORD");
    $request = new RouterOS\Request('/ip/hotspot/host/print detail=""');
    $responses = $client->sendSync($request);
    foreach ($responses as $response) {
        // response..
    }
?>

Output :

[.id] => *3
[mac-address] => **:**:**:**:**:**
[address] => **.**.**.**
[to-address] => **.**.**.**
[server] => hotspot1
[uptime] => 7h21m29s
[idle-time] => 1m42s
[idle-timeout] => 1h
[host-dead-time] => 1m42s
[bytes-in] => 91475457
[bytes-out] => 467730534
[packets-in] => 377432
[packets-out] => 407816
[found-by] => UDP :** -> **
[authorized] => false
[bypassed] => true
[comment] => **

// no tx-rate or rx-rate

In RouterOS terminal of the command ip hotspot host print arguments

append  bytes       detail  follow       from      packets  where         
brief   count-only  file    follow-only  interval  status   without-paging

I've tried to pass arguments detail="" / status="" / bytes="" but nothing returned the tx-rate/rx-rate to be exact all these return the same output nothing more or less.

i can remember a time ago i had been able to retrieve tx-rate & rx-rate on RouterOS version 6 but cannot remember which one exactly. and these wasn't retrieving also on version lower than 6 for example v5.25

What causes this?

Thanks.
 
User avatar
loloski
Member Candidate
Member Candidate
Posts: 277
Joined: Mon Mar 15, 2021 9:10 pm

Re: API get tx-rate/rx-rate of hotspot hosts in response using Pear2/RouterOS

Thu Jun 17, 2021 9:52 am

Hey,

did you manage to find a workaround to extract this information? I also need this particular info for one of my pet project I can concur that i saw the same thing on ROS 6.48.3
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: API get tx-rate/rx-rate of hotspot hosts in response using Pear2/RouterOS

Thu Jun 17, 2021 10:14 am

tx-rate and rx-rate parameters does not exist in that menu.

List of available parameters:
https://wiki.mikrotik.com/wiki/Manual:I ... tspot_host
 
User avatar
loloski
Member Candidate
Member Candidate
Posts: 277
Joined: Mon Mar 15, 2021 9:10 pm

Re: API get tx-rate/rx-rate of hotspot hosts in response using Pear2/RouterOS

Thu Jun 17, 2021 10:18 am

tx-rate and rx-rate parameters does not exist in that menu.

List of available parameters:
https://wiki.mikrotik.com/wiki/Manual:I ... tspot_host
Why in the winbox GUI it was there i'm fairly confused if the intention was not to include this tx-rate/rx-rate in the API why it was available in the gui, I'm under the impression this tx-rate/rx-rate will also in the APi because it was there in the winbox GUI

this tx-rate/rx-rate was missing on both /ip/hotspot/active/print and ip/hotspot/host/print
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: API get tx-rate/rx-rate of hotspot hosts in response using Pear2/RouterOS

Tue Jun 22, 2021 11:37 am

You can calculate your own tx rates or rx rates from bytes and packets varaibles (just as winbox does it)

Who is online

Users browsing this forum: Ellaham, patrikg, rextended and 26 guests