Is it possible to send reports via e-mail if user has downloaded(uploaded) certain amount of information? I need to use [/queue simple] counters if possible… I’ve tryed to modify the script based on [/ip firewall rule accounting], but no luck
Please help!
My current (not working) script is:
:global tx
:foreach i in [/queue simple find] do={
/queue simple $i once do={
:set tx ($total-bytes/1048576)
:if ($tx > 0) do={
/tool e-mail send
to=xxxxx@xxxxx.com
subject=“data report”
body=("The traffic on " .
[/queue simple get $i name] . " got up to " . $tx . “Mbit”)
}
}
}
The following script works fine in v 2.9, but in 2.8 the value [total-bytes] is string! And I dont know how to convert it to integer.. Without this it’s impossible to get any calculations
:local tx
:foreach i in [/queue simple find] do={
:set tx ([queue simple get $i total-bytes]/1073741824)
:if ($tx > 1) do={
/tool e-mail send \
to=a@a.com \
subject="data rate report" \
body=("The traffic on " . \
[queue simple get $i name] . " got up to " . $tx . "Gb, in details it is " . \
[queue simple get $i bytes])
}
}
/queue simple reset-counters
Anybody know how to translate the value [total-bytes] in to integer for use in v 2.8.x??