function for ethernet status

Hello,
I am trying to create a function in dude in order to be alble to check the status of the ethernet in my mikrotik routers but i cant find the correct function. What i need is a function to check if the status of the ethernet has rate 100Mbps. I dont want to do it with SNMP because some times it doesnt. work. Do you have any ideas how to do that?
thanks in advanced!

Use my funcion “check_ether1” as example:

check_ether1

if(device_property("Ros"),ros_command(":if ([/interface ethernet get [find where default-name=\"ether1\"] value-name=running]) do={:put 1} else={:put 0}"),0)

Thank you for your reply!
Here is what i tried for test but i get error:

ros_command(":if ([/interface ethernet get [find where default-name=\"ether1\"] auto-negotiation]=yes) do={ ([/interface ethernet monitor numbers=[find where default-name=\"ether1\"] once]) do={:if ($rate="100Mbps") do={:put 100} else={:put 10}")}}

I inserted this code as a function in dude but it gives me the code as error. Any ideas?