Monthly traffic monitor?

Yes of course, but I was talking about the possibility of using fetch to read the residual traffic directly from the RouterBOARD... :joy:

If provider sent SMS, can be readed here...

If that was the case, why would I ask "How can I learn and do this?" as a reply to your very first reply? :slight_smile:

I still hope for an answer to that.

As a whole, I thought there might be a simple way. Some crappy Huawei LTE router has that functionality out of the box, so I was assuming MikroTik might have at least that (if not better).

Peace.

I didn't think I needed to say this...
read the official documentation,
experiment, and use the ten thousand scripts on the forum as examples.
Practice and understand how it works.

Once you finally understand, you create what you need, either from scratch or by adapting some existing script.

I use this script currently to monitor my monthly bandwidth usage, but it requires external USB to be connected to device in order data to be writen to it and saved. Im not sure that is helpfull in your case specially because its writen that " the MikroTik device is not powered all the time". There is no other way to monitor data usage on the same device.

Perhaps this could be a more simple solution;

https://kb.netgear.com/24225/How-do-I-monitor-Internet-traffic-on-my-Nighthawk-router

As previously mentioned, the provider traffic counter will probably be a bit higher than what the router records.
If the router loses the data when powered off, the results would have to be written to paper at the end of each session and added up. Over time, you might get an idea of how close to the limit you can go to avoid an overage.

I don't think the instructions for that feature in a Netgear router apply to a MikroTik product...

Very true! But if the original poster sticks with the MikroTik router, the implementation of a solution could be as difficult as some of the previous posts have suggested. I may have also overlooked that an LTE router is needed.

MikroTik has a fleet of LTE devices, but there is no built-in way to monitor (or limit) data usage. Nice.

As written in another post, to monitor traffic usage, you should use the tools already made available by the provider.
That's all that matters...

The provider doesn't care if you say you used 9 because you log 9 on your router, if it say 10 is 10...

And I'm not just talking about MikroTik...

I know this problem from personal experience. Every ISP has its own billing logic, so monitoring data usage on the client device can be quite inaccurate. For years, I had a 5 GB data plan for my smartphone, and I was very glad that Android allows setting a data limit. I simply set it to 4.9 GB, and I could be sure not to exceed the 5 GB dataplan. If Android blocked data after 4.9 GB, I could still check my ISP's customer panel to see how much data was actually remaining. I always considered this more as a safety measure rather than a way to track exactly when and how much data I used. If I had exceeded the limit, the ISP would have automatically charged me for an additional 1 GB at a rather high price.

Another way of tracking your monthly data usage would be to stand up something like Cacti as a VM or container somewhere external to your router and then use that to poll your router for interface statistics periodically via SNMP. Cacti can use those stats to show you graphs of rates averaged across a time interval (default is five minutes out of the box but this can be tweaked), as well as cumulative data usage counts for a specific interface over a specific period of time. The fact that your router isn't always powered up would probably produce spikes in the throughput graphs when the router comes back online but those spikes can optionally be discarded by Cacti, and I don't think it would have any impact on the cumulative data usage records which I assume is all you care about anyway.

@rextended

As written in another post, to monitor traffic usage, you should use the tools already made available by the provider.

I use them but I prefer not to as there are considerations which I prefer not to go into, as they are off-topic.

I also want to be able to check that even when I am not connected to the Internet which is not possible with provider's tools.

So, I am simply asking how to do this on a MikroTik device.

@infabo

I have seen that too. In my case I have found it is due to the confusion in definitions which providers use in a way that profits them better:

https://en.wikipedia.org/wiki/Megabyte#Definitions

@SomeGuyNamedTate

I know how to do that in a VM on the PC but that will count only the traffic of the PC (unless some extra steps are taken to route all LAN traffic through that VM which is not the goal) and it will need the PC to be always on.

Thanks everyone for the feedback. I understand this is probably not simple to do.

Does your ISP sends SMS when your near to limit, eg. when 1Gb is left? You can act on thet alert is such alert is received, with for eg. SMS to email script to manually react and/or apply automatically some QoS rules to limit speed…

My ISP for eg. has mobile app with widget from which I can in any time check currently remaining traffic and also traffic at night is not counted (never investigated actual hours).

Well, THAT is not correct. You can use SNMP to have the PC ask the router about the traffic on the LTE interface. That will count the traffic correctly. Of course you are right the PC has to be running all the time.

When you would make a scheduled script on the router it would be possible to do the same (you can read the interface counters in a script) but the problem is in the “(the MikroTik device is not powered all the time)” bit. That makes it all a lot more complicated.

Nowhere does it say not to use the tools provided by the vendor.
Edit the title and first post to indicate what is off-topic.

@utiker, like everyone has already said, it is the provider's counter that matters. However, if you just want to have an idea of the traffic consumption, understanding that it might not be 100% accurate, my WAN traffic script already linked above should get the job done. It's designed to store data on a USB storage device but can be easily changed to internal flash (if you are OK with increased flash wear). If you have a local 24/7 server with a CIFS share, I'm pretty sure the script can be modified slightly to save the data there.

The script supports router reboots, but you will have to test and see how well it works when the router is off for days and the date is off until it's synchronized.

You would also need to either schedule the script to run more frequently to minimize traffic data loss or, better, take care to power it off gracefully after running the script to save all traffic data.

The only complication I see is if you need billing periods other than beginning of the month. Then the script cannot be used as is without (possibly heavy) modification.

I understand you were looking for a simple built-in solution, however, there isn't one in RouterOS. The next easiest thing is to benefit from existing scripts written by the community members.

@optio

Does your ISP sends SMS when your near to limit, eg. when 1Gb is left?

Not for the particular service I am using.

You can act on thet alert is such alert is received

I need the monitoring to help me plan how to use what remains, rather than find out post factum that there is almost nothing left to use.

My ISP for eg. has mobile app [...]

Mine has one too:

"This app may share these data types with third parties
Personal info
This app may collect these data types
Location, Personal info and 2 others
Data is encrypted in transit
You can request that data be deleted
See details"

which I choose not to use.

@rextended

Nowhere does it say not to use the tools provided by the vendor.
Edit the title and first post to indicate what is off-topic.

I assume I am discussing with intelligent people.

@anserk

Thank you for sharing your script!
I will look into it.

These infos ISP already have from you unless you are using someone else subscription or you are using anonymously purchased prepaid SIM (some countries it is still possible to purchase, but data plan is usually low).

Also Location service can be explicitly disabled for app if that is concern.