Page 1 of 1
Script to monitor interface bytes
Posted: Fri Aug 18, 2017 2:13 am
by actnoon
:global monitorIN1 0;
:global monitorIN2 0;
:local newin1 0;
:local newin2 0;
:local usedin1 0;
:local usedin2 0;
:local totalin1 0;
:local totalin2 0;
:set newin1 ([/interface get [find name=IN1] rx-byte] + [/interface get [find name=IN1] tx-byte]);
:set newin2 ([/interface get [find name=IN2] rx-byte] + [/interface get [find name=IN2] tx-byte]);
:set usedin1 [/interface get [find name=monitor1] comment];
:set usedin2 [/interface get [find name=monitor2] comment];
:set totalin1 ($newin1 + $usedin1);
:set totalin2 ($newin2 + $usedin2);
/interface set [find name=monitor1] comment= $totalin1;
/interface set [find name=monitor2] comment= $totalin2;
:set monitorIN1 ($totalin1 / 1073741824);
:set monitorIN1 ($monitorIN1." GB");
:set monitorIN2 ($totalin2 / 1073741824);
:set monitorIN2 ($monitorIN2." GB");
/interface ethernet reset-counters IN1;
/interface ethernet reset-counters IN2;
:log info("Interfaces counters have been reset");
I got a syntax error and a script error when I put that script into terminal
any help would be appreciated

Re: Script to monitor interface bytes
Posted: Tue Sep 19, 2017 1:41 pm
by SilverNodashi
Can you post the syntax error and script error here?
Re: Script to monitor interface bytes
Posted: Tue Dec 12, 2017 1:15 pm
by Ma7m0d
hi all i need script to make a qouta like 20 GB to a name in simple queue monitor upload and download when ritch a limt speed well be change to 128
Re: Script to monitor interface bytes
Posted: Fri Dec 15, 2017 5:01 pm
by ADahi
hi all i need script to make a qouta like 20 GB to a name in simple queue monitor upload and download when ritch a limt speed well be change to 128
viewtopic.php?f=9&t=126573#p631249
Re: Script to monitor interface bytes
Posted: Fri Dec 15, 2017 5:15 pm
by ADahi
{
:global monitorIN1 0;
:global monitorIN2 0;
:local newin1 0;
:local newin2 0;
:local usedin1 0;
:local usedin2 0;
:local totalin1 0;
:local totalin2 0;
:set newin1 ([/interface get [find name=IN1] rx-byte] + [/interface get [find name=IN1] tx-byte]);
:set newin2 ([/interface get [find name=IN2] rx-byte] + [/interface get [find name=IN2] tx-byte]);
:set usedin1 [/interface get [find name=monitor1] comment];
:set usedin2 [/interface get [find name=monitor2] comment];
:set totalin1 ($newin1 + $usedin1);
:set totalin2 ($newin2 + $usedin2);
/interface set [find name=monitor1] comment= $totalin1;
/interface set [find name=monitor2] comment= $totalin2;
:set monitorIN1 ($totalin1 / 1073741824);
:set monitorIN1 ($monitorIN1." GB");
:set monitorIN2 ($totalin2 / 1073741824);
:set monitorIN2 ($monitorIN2." GB");
/interface ethernet reset-counters IN1;
/interface ethernet reset-counters IN2;
:log info ("Interfaces counters have been reset");
}
space after ":log info " , and do not forgot to put script inside
{ }