Community discussions

MikroTik App
 
tvermoes
just joined
Topic Author
Posts: 10
Joined: Thu Mar 29, 2012 11:38 pm

Hotspot Email Trial User Data

Thu Jul 04, 2013 10:12 pm

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"
 
Etza
newbie
Posts: 46
Joined: Tue May 31, 2011 10:33 pm

Re: Hotspot Email Trial User Data

Thu Oct 10, 2013 1:00 pm

hi do you chek this ?
is it work ?
thx
 
PaulCove
just joined
Posts: 2
Joined: Wed Nov 06, 2013 5:29 pm

Re: Hotspot Email Trial User Data

Thu Nov 07, 2013 12:38 am

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