Hey, I’m trying to set up a MikroTik script to monitor traffic on ether1 and send an email if it goes above 1MB. I wrote this script, but it’s not working as expected - sometimes it doesn’t send the email, and I’m seeing an error in the log that says ‘input does not match any value of name’. Here’s my code:
/interface monitor-traffic
:local rxTraffic [/interface get [find name="ether1"] rx-byte]
:if ($rxTraffic > 1000000) do={
/tool e-mail send to="admin@example.com" subject="High Traffic Alert" body="Traffic on ether1 exceeded 1MB!"
} else {
:log info "Traffic normal on ether1"
}
Can anyone spot what’s wrong? I’m new to MikroTik scripting and could use some help!