sqlcounter does not work

Philemon Jaomalaza philemon.jaomalaza at gmail.com
Tue Jan 8 06:51:15 CET 2019


Hello Dear,

 

I use time counters to limit session time without any problem.

Now, on the same system, I must also configure the traffic limit.

 

The problem is that if you use a traffic counter (daily or monthly), the
user stays connected even if the quota is exceeded.

 

To do it, I proceeded like this:

 

# nano /etc/freeradius/3.0/dictionary and add this:

 

ATTRIBUTE Max-Monthly-Traffic 3003 integer

ATTRIBUTE Monthly-Traffic-Limit 3004 integer

 

#nano /mods-config/sql/counter/mysql/monthlytrafficcounter.conf and add
this:

 

query = "SELECT SUM (acctinputoctets + acctoutputoctets) FROM radacct WHERE
UserName = '% {$ {key}}' AND UNIX_TIMESTAMP (AcctStartTime)> '%% b'"

 

Then, in / mods-available / sqlcounter, I added:

 

sqlcounter monthlytrafficcounter {

        sql_module_instance = sql

        #dialect = $ {modules.sql.dialect}

        dialect = "mysql"

        counter_name = Monthly-Traffic

        check_name = Max-Monthly-Traffic

        reply_name = Monthly-Traffic-Limit

        key = User-Name

        reset = monthly

        $ INCLUDE $ {modconfdir} / sql / counter / $ {dialect} / $ {.:
instance} .conf

}

 

and enable it:

 

# cd /etc/freeradius/3.0/mods-enabled

ln -s ../mods-available/sqlcounter sqlcounter

 

# nano /etc/freeradius/3.0/sites-enabled/default

authorize {

    ...

    sql

    # check monthly usage limit

    monthlytrafficcounter

    ...

}

 

and restart freeradius

 

Could you help me to find out why it does not work?

 

 

JMLZ

 



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


More information about the Freeradius-Users mailing list