Send user notification on data usage
aland at deployingradius.com
Wed Mar 15 14:40:13 CET 2017
On Mar 14, 2017, at 9:44 AM, Sachin Yadav via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> We are using freeradius to control our WiFi hotspot. We have implemented FUP limits for users based on day/week/month.<br/>
What's a FUP limit?
> Now, we want to send a user notification if the user has used - let's say 80% of daily allowed limit, informing that data is about to finish, in the form of email/sms.<br/>
> I have 2 ways to implement it -<br/>
> 1. Some hook at freedaius side which can look at consumption in interim updates and based on logic call a webservice(or anything else) which will further take care of notification sending part.<br/>
You can write if / then / else logic in FreeRADIUS. And then run a script which sends email.
> 2. Have a bot which will constantly read on radacct table and will send notification if required.<br/>
Even once an hour should be good enough.
> I am more inclined towards approach 1 as it would be a neat and fast way of doing it. Reading a highly transaction table such as radacct is no good idea. Kindly suggest.
It's up to you. I don't think it matters much either way. If you have decent indexes on the table, a SELECT of users with 80% utilization should take almost no resources.
And, you'll need to track which users got an email already. Which means writing that information to the DB. And you'll have to do this for both situations, above.
More information about the Freeradius-Users