Hi all, how can i get from the command line the status rate of an ethernet interface? I can get the full duplex status like this:
interface ethernet get ether full-duplex
but i cant find the rate. Can anyone help?
Hi all, how can i get from the command line the status rate of an ethernet interface? I can get the full duplex status like this:
interface ethernet get ether full-duplex
but i cant find the rate. Can anyone help?
This value is under name “speed”
try this
{:local a [/interface ethernet get ether1 value-name=speed]; :put “$a”}
$trequest = new RouterOS\Request('/interface ethernet monitor numbers=ether1 once');
$result = $client->sendSync($trequest)->current();
echo json_encode(array(
'status' => $result('status'),
'speed' => $result('rate')
));
and show all ethernet
$request = new RouterOS\Request('/interface/ethernet/print');
$request->setQuery($query);
$responses = $client->sendSync($request);
foreach ($responses as $response) {
foreach ($response as $name => $value) {
echo "| {$name} = {$value} |";
}
echo "<br>";
}
![]()
:put ([/interface ethernet monitor ether1 once as-value]->"rate")
You can also define a function:
:global statusinfo do={:return ([/interface ethernet monitor $1 once as-value]->$2) }
And then get any status info, like rate: [$statusinfo ether1 rate], advertising: [$statusinfo ether1 advertising] …
PS: speed and rate are not the same, speed is a setting, rate is a state.