Hello
How can i find downloaded byte for a specific user by script?
Thanks.
Chap
Hello
How can i find downloaded byte for a specific user by script?
Thanks.
Chap
what is your goal? maybe there is a solution already
Thanks for quick reply.
I want to write a script that script will check all the simple queues shearching their target adresses and will search a whole 192.168.1.0/24 subnet. It will read their total-bytes (recieved transmited) and will check them if they crosed a limit of 100 MB ( 104857600 bytes) If they did , they will be limited to lower speed (64k/64k)
Note: I am using RoterOS 3.13.
Chap
I cant find access to counters from command promt..
(/queue simple get or set)
so there is no way.. mb..
Just tried:
[admin@VitellOffice] > /queue simple
[admin@VitellOffice] > add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s comment="" direction=both disabled=no dst-address=0.0.0.0/0 interface=ether1 limit-at=512k/512k max-limit=512k/512k name=queue1 parent=none priority=8 queue=default-small/default-small target-addresses=0.0.0.0/0 total-queue=default-small
[admin@VitellOffice] > :put [/queue simple get queue1 bytes]
115344/854216
[admin@VitellOffice] >
Is this what you were after?
:local UserBytesText;
:local UserBytes
:set UserBytesText [/queue simple get [/queue simple find ... some criteria] bytes];
next ur need to decompose string "115344/854216" to two numbers or find command which returns one number.
it is possible to decompose using :pick command (see manual) - find "/" symbol and make two strings.
:set UserBytes (ur decompose script)
:if (UserBytes > UserLimit) do={
/queue simple set [/queue simple find ... some criteria] max-limit=64k/64k;
}
and run it in big :for {…} cycle for all needed users..
but best idea is use normal billing for this thing.
or you have many unknown problems with this pseudo-billing based on counters.
(especially if queues adds dinamycally)..