Created
March 24, 2024 21:07
-
-
Save jazzbanzai/9625ea59437a9ed1a99508445719ca04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Collect the Data Stats from a MikroTik LTE Interface | |
#make the empty file | |
#/file print file="lteCount.txt" | |
{ | |
#Get RX and TX data from LTE1 interface | |
:local counterRX [/interface get lte1 rx-byte] | |
:local counterTX [/interface get lte1 tx-byte] | |
#Convert to MB | |
:local counterALL [(($counterRX+$counterTX)/1000000)] | |
#Get Date/Time | |
:local date [/system clock get date] | |
:local time [/system clock get time] | |
#Print and Log | |
:put "$date--$time : Interface LTE1 total Data: $counterALL MB" | |
:log info "$date--$time : Interface LTE1 total Data: $counterALL MB" | |
:local before value=[/file get "lteCount.txt" contents] | |
/file set "lteCount.txt" contents="$before \n $date--$time : Interface LTE1 total Data: $counterALL MB" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment