I ise the fallowing code to calculate the total download for the hotspot users, but there is errors:
Code: Select all
:local bytesin 0;
:local bytesout 0;
/ip hotspot user {
:foreach u in=[find] do={
:set bytesin ($bytesin + [get $u bytes-in]);
:set bytesout ($bytesout + [get $u bytes-out]);
}
}
:set bytesin ($bytesin / (1024 * 1024 * 1024));
:set bytesout ($bytesout / (1024 * 1024 * 1024));
:put ("Bytes-In(GB): " . $bytesin);
:put ("Bytes-Out(GB): " . $bytesout);