How to save the interface rate to a variable??

How to save the interface rate to a variable??
I want to compare two interface rates and do some actions.
Thank you.

example


:local checkTraffDown  ( [/interface monitor-traffic ether1 as-value ]->"rx-bits-per-second") 
:if ($checkTraffDown>10) do= {.......}

I the ‘Rate’ refers to the current speed of the ethernet interface, AFAIK the only way is via SNMP, at oid “1.3.6.1.2.1.2.2.1.5.$interface”

I would really like to be able to use in scripting but at the moment you have to use an external apliaction that combines API and SNMP, p.ex.

/interface ethernet monitor ether1 once do={ :put $rate }