hi all
RB951 V6.7, hotspot ( username & password) i give my users a limit-bytes-total
i want to read my users remain bytes
i try this script but it was wrong
:foreach i in=[/ip hotspot user find] do={
local bi [/ip hotspot user get $i bytes-in]
local bo [/ip hotspot user get $i bytes-out]
local user [ip hotspot user get $i user]
log info “user $user and bi $bi and bi $bo”
}
any help pleas?
and if it is possible can i write this value to a txt file in the rb??
thanks
:foreach tmpI in=[/ip hotspot user find where (limit-bytes-total > 0)] do={
:local tmpName value=[/ip hotspot user get $tmpI value-name=name];
:local tmpLimitTotal value=[/ip hotspot user get $tmpI value-name=limit-bytes-total];
:local tmpIn value=[/ip hotspot user get $tmpI value-name=bytes-in];
:local tmpOut value=[/ip hotspot user get $tmpI value-name=bytes-out];
:local tmpRemaining value=($tmpLimitTotal - ($tmpIn + $tmpOut));
:local tmpMessage value=("User: ".$tmpName.", Limit Total: ".$tmpLimitTotal.", Used In: ".$tmpIn.", Used Out: ".$tmpOut.", Remaining Total:".$tmpRemaining);
:if ([/ip hotspot user get $tmpI value-name=disabled]) do={:set tmpMessage value=("USER DISABLED: ".$tmpMessage);};
:if ($tmpRemaining < 1) do={:set tmpMessage value=("USER OUT OF BYTES: ".$tmpMessage);};
:log info message=$tmpMessage;
}
Is possible to write output to text file, each 100 users, using different file names.
Is not possible to store, on each file, more than 4096 Characters.
thanx alot
1- how to wright this txt file? i got only the last user details?
2- i’v asked many times but no answer : can i send any kind of msg (or send txtfile over wifi) to my users when they r online and make it appear on their (mobiles-pc-laptops)