Traffic Volume Limit per Month cannot exceed 4Gbytes

chenjiang chenjiang at microshield.com.cn
Wed Mar 25 06:37:19 CET 2015


   Hi! Herwin

   It works and thanks for your great help!
   BR!
   Chen Jiang
   Microshield Technology Co., Ltd
   å京å¸æµ·æ·åºè¥¿ä¸ç¯åè·¯50å·è±ªæ大å¦C2座18-19å± 100048
   (86)10-88518768
   (86)18612696123
   [1]chenjiang at microshield.com.cn
    åå§é®ä»¶
   å件人: Herwin Weststrate<herwin at quarantainenet.nl>
   æ¶ä»¶äºº: FreeRadius users mailing
   list<freeradius-users at lists.freeradius.org>
   åéæ¶é´: 2015å¹´3æ19æ¥(å¨å)â18:50
   主é¢: Re: Traffic Volume Limit per Month cannot exceed 4Gbytes
On 19-03-15 11:40, chenjiang wrote:
>    Hi! Experts
>
>    I want to achieve user traffic volume limit per month, but found there
>    is a limit for user traffic to exceed 4Gbytes.
>
>    Below is my DB structure, you could see the
>    "Max-Monthly-Trafficâ groupcheck attribute is 10Gbytes and it type
>    is âvarchar", but it seems system deal it like a âinteger" type, so it
>    cannot exceed 4Gbytes.
>
>    mysql> select * from radgroupcheck;
>
>    +----+--------------------+-----------------------+----+------------+
>    | id | groupname          | attribute             | op | value      |
>    +----+--------------------+-----------------------+----+------------+
>    | 25 | group2             | Max-Monthly-Traffic   | := | 10737418240|
>    +----+--------------------+-----------------------+----+------------+
>
>    3 rows in set (0.00 sec)
>
>    In FreeRADIUS debug mode, we could see that the rlm_sqlcounter
>    âcheck_itemâ is always warpped in 4294967296 just like below:
>
>    [monthlytrafficcounter]
>
>    expand: %{sql:SELECT SUM(acctinputoctets+acctoutputoctets) FROM radacct
>    WHERE username='lichan' AND UNIX_TIMESTAMP(acctstarttime) >
>    '1425139200'} -> 7250810110

Change the last query to "SUM(...)/1024", divide the value in
radgroupcheck by 1024 as well. This way it's less accurate, but that
wouldn't matter much when comparing these kind of values.

--
Herwin Weststrate
-
List info/subscribe/unsubscribe? See [2]http://www.freeradius.org/list/users.htm
l

References

   1. mailto:chenjiang at microshield.com.cn
   2. http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list