Send user notification on data usage

Sachin Yadav sachin0235 at yahoo.com
Wed Mar 15 15:34:52 CET 2017


Thanks a lot Alan for your reply. FUP is fair usage policy, how much data a user consumed in a  fixed timeframe.
-- You can write if / then / else logic in FreeRADIUS

Would you be kind enough to provide an example or few lines on where exactly I can put this logic in freeradius? 

    On Wednesday, March 15, 2017 7:10 PM, Alan DeKok <aland at deployingradius.com> wrote:
 

 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.

  Alan DeKok.


   


More information about the Freeradius-Users mailing list