Skip to content

Instantly share code, notes, and snippets.

@i3130002
Last active January 26, 2022 07:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i3130002/b6e03c47dfe7a43665a8ce64afeac8b3 to your computer and use it in GitHub Desktop.
Save i3130002/b6e03c47dfe7a43665a8ce64afeac8b3 to your computer and use it in GitHub Desktop.

Mikrotik log interface(ether1) traffic

This can be placed on an scheduler and logs your traffic like every hour or so.

{
:set $tx ([/interface get ether1 tx-byte]/1048576)
:set $rx ([/interface get ether1 rx-byte]/1048576)
:log debug "Traffic log,TX,$tx,RX,$rx;"
}

The log of script can be set to disk file for persistance

link

The following can be used to detect reboot (If added as a scheduler with poweron startup)

{
:log debug "Traffic log,==============reboot============"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment