Iam a new guy in mikrotik products and i have just bought an rb1000 router.its running version 3.23. iam facing problems in writing some scripts to automate my system.
- need a script that monitors monthly usage for an ip address and disable browsing as the limit is exceeded.
- send an email to client about how they have used their allocated monthly traffic.
for the 1st option, i tried this script i found on the internet but its not running.i just copied it to my scheduler with the winbox application.i think the routeros is failing on the option :set traffic xxxxxxx because if i got to my mikrotik terminal prompt and type :set ? the option that is there is :set i .i dont know how to go about it and i need to implement this as soon as possible.
:local traffic
/queue simple
:for i from=1 to=254 do={
:set traffic [get [find target-addresses=“192.168.7.$i/32”] total-bytes]
:if ($traffic > 1000000000) do={
/ip firewall filter
add chain=forward comment=“Oh behave, baby!”
src-address=(“192.168.7.$i”) dst-address=0.0.0.0/0 action=drop
}
}