hi
how to get these values tx ant rx using api
interfaces > Ethernet > TX and RX
<?php
require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar';
use PEAR2\Net\RouterOS;
$util = new RouterOS\Util(
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
);
$monitorTrafficResponses = $client->sendSync($util->setMenu('/interface')
->newRequest('monitor-traffic', ['once', 'numbers' => $util->find()]));
echo '<table>';
foreach ($monitorTrafficResponses as $monitorTrafficResponse) {
echo '<tr>';
foreach ($monitorTrafficResponse as $prop => $value) {
echo "<th>{$prop}</th><td>{$value}</td>";
}
echo '</tr>';
}
echo '</table>';
Hi , once param. makes it static , how can i dynamically get the rx/tx? even when i removed the once it gets only a shot of the rx/tx valuesUsing the API client from my signature:Code: Select all<?php require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar'; use PEAR2\Net\RouterOS; $util = new RouterOS\Util( $client = new RouterOS\Client('192.168.88.1', 'admin', 'password') ); $monitorTrafficResponses = $client->sendSync($util->setMenu('/interface') ->newRequest('monitor-traffic', ['once', 'numbers' => $util->find()])); echo '<table>'; foreach ($monitorTrafficResponses as $monitorTrafficResponse) { echo '<tr>'; foreach ($monitorTrafficResponse as $prop => $value) { echo "<th>{$prop}</th><td>{$value}</td>"; } echo '</tr>'; } echo '</table>';