Code: Select all
/interface monitor-traffic Hotspot-Bridge once do={:put ($"tx-bits-per-second")}
The code below does not work... while the code above works at winbox
Code: Select all
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2/Autoload.php';
//$monitorRequest = new RouterOS\Request(
// '/interface/monitor-traffic .proplist=rx-bits-per-second,tx-bits-per-second'
//);
$client = new RouterOS\Client('10.50.160.36', 'admin', 'webdev@2017');
$requests = new RouterOS\Request('/interface monitor-traffic Hotspot-Bridge');
$requests->setArgument('once');
$requests->setArgument('do', ' ($"tx-bits-per-second") ');
$result = $client->sendSync($requests)->current();
print_r($result);
?>
PEAR2\Net\RouterOS\Response Object ( [unrecognizedWords:protected] => Array ( ) [_type:PEAR2\Net\RouterOS\Response:private] => !trap [attributes:protected] => Array ( [message] => no such command ) [_tag:PEAR2\Net\RouterOS\Message:private] => )