Page 1 of 1

Hotspot Email Trial User Data

Posted: Thu Jul 04, 2013 10:12 pm
by tvermoes
This script will make and Email a CSV-list of Trial Users and their usage.

!!!!!!!!!! : Make sure that Email from the router is working.
:local emailaddress "YOURMAIL@YOURDOMAIN.COM"
:local date [/system clock get date]
:local emailsubject
:local emailbody
:local freeusers
:local trialuser
:local bdown
:local bup
:local pdown
:local pup
:set freeusers "Name,Packets-Upload,Packets-Download,Bytes-Upload,Bytes-Download"
:foreach counter in=[/ip hotspot user find where dynamic=yes] do={
:set trialuser [/ip hotspot user get $counter name]
:set bup [/ip hotspot user get $counter bytes-in]
:set bdown [/ip hotspot user get $counter bytes-out]
:set pup [/ip hotspot user get $counter packets-in]
:set pdown [/ip hotspot user get $counter packets-out]
:set freeusers "$freeusers\r\n$trialuser,$pup,$pdown,$bup,$bdown"
}


:set emailsubject "Trial Users ($date)"
:set emailbody "$freeusers\r\n\r\n"
/tool e-mail send to="$emailaddress" subject="$emailsubject" body="$emailbody"

Re: Hotspot Email Trial User Data

Posted: Thu Oct 10, 2013 1:00 pm
by Etza
hi do you chek this ?
is it work ?
thx

Re: Hotspot Email Trial User Data

Posted: Thu Nov 07, 2013 12:38 am
by PaulCove
I want to receive an email each hour showing for each user the bytes-in and bytes out, either in that hour or accumulative, until I reset the counters.

Can this script be modified to do this?

Thanks

Paul