limit usage for LTE

I have seen this article describing limiting usage for a group of IP addresses, could I get some help creating a script that will measure total usage in and out for an interface, in my case LTE and disable the interface once reached. Then I can reset that usage once a day. I have a 5GB usage limit, before i get expensive automatic data addons added, so I am thinking I can set a daily limit for 166MB

  • specifically, how can I read total-bytes for an interface and then reset that counter in a separate script?

I cant seem to even get total-bytes to display for any queue either in a terminal, or looking at the Simple Queue → Total Statistics window.

Use this script from the post of accord (post 16).
http://forum.mikrotik.com/t/interface-data-quota/79514/17

This script (slightly adapted to your interface) works great!
It should achieve what you want.
It is not very well documented/commented, but just copy it, and change the interface name to your LTE interface.
Then see the L7 firewall values if the data rate is measured.

I run this script every 1h (as I switch LTE on and off when needed), but if it runs 24/7 you could do it only ones or twice during the day
(it is writing to FLASH memory as values remain after reboot).

Don’t use the more recent scripts in that topic (I have not tested it).