Is there a way to get interface speed in bytes?

I know you can use monitor and filter for rate to get something like “10Gbps”, but is there something like

“/interface ethernet get rate” that will return it in bytes? For example “10000000000”. Reason is so we can do math on it in our scripts for changing cost, on interfaces, etc.

Why not just have a pair of lists like {“1Gbps”;“2.5Gbps”;“10Gbps”} and {1000;2500;10000} and then :find in one and index the other…

EDIT: Oh, you meant bytes :slight_smile:

Just one example

/interface ethernet
:global arrRates   [:toarray "10Mbps,100Mbps,1Gbps,2.5Gbps,5Gbps,10Gbps,25Gbps,40Gbps,50Gbps,100Gbps"]
:global arrMSpeeds [:toarray "    10,    100, 1000,   2500, 5000, 10000, 25000, 40000, 50000, 100000"]
:foreach item in=[find] do={
    :if ([get $item running]) do={
        :local read  [monitor $item once as-value]
        :local srate ($read->"rate")
        :local Brate (($arrMSpeeds->[:find $arrRates $srate -1]) * 1000000 / 8)
        :put "$($read->"name") rate is $srate ($Brate Bps)"
    } else={
        :put "$[get $item name] is not running"
    }
}