You dont understand the way the counter works.
As stated in the experimental.conf:

         #  The 'reset' parameter defines when the counters are all
        #  reset to zero.  It can be hourly, daily, weekly, monthly or
        #  never.  It can also be user defined. It should be of the
        #  form:
        #       num[hdwm] where:
        #       h: hours, d: days, w: weeks, m: months
        #       If the letter is ommited days will be assumed. In example:
        #       reset = 10h (reset every 10 hours)
        #       reset = 12  (reset every 12 days)

In your case you should change reset=never to reset=1h if you want to reset the 
counter every hour.
But in that case it would not make sense to call it Max-Hour-Session-Time since 
the counter would be reset after the user's time is off and then she would be 
able to login again...

What do you exactly wanna do? Your config as it is now does not make any sense.
Your SQL says you want to allow your users to stay on 24 hours a day. But then 
you want to reset the counter every hour?
That would make sense if the reset value was greater than the corresponding 
value of your Max-XYZ-Session.


Here is my sqlcounter I use for daily, weekly, monthly and unlimited resets:
http://www.yazzy.org/configs/linux/freeradius/sqlcounter.conf

And btw, the Attribute field in the radgroupcheck table must be the same as the 
value of check-name, e.g:
INSERT INTO radgroupcheck (id,GroupName,Attribute,op,Value) VALUES 
(1,'01hour','Max-Daily-Session',':=','3600');


On Wed, 11 May 2005 13:55:55 +0700
avudz <[EMAIL PROTECTED]> wrote:

> 
> Monday, May 9, 2005, 9:34:05 PM, you wrote:
> 
> SE> Hm... maybe you should set the SQL statements in your sqlcounter.conf file
> SE> that can be usually found in /etc/raddb or
> SE> /usr/local/etc/raddb depending on
> SE> distribution... 
> 
> SE> You can define the different counters for your vouchers that will count 
> time
> SE> or traffic by defining them in the file I mentioned... 
> 
> SE> I dont know, but maybe you should take a look at
> SE> /usr/share/doc/packages/freeradius/rlm_sqlcounter if you already didnt do
> SE> that...
> 
> hello, i still cant solve the problem about 1 day limit. now im thinking to 
> put in
> sqlcounter.conf :
> 
> sqlcounter hourcounter {
>                 counter-name = Max-Hour-Session-Time
>                 check-name = Max-Hour-Session
>                 sqlmod-inst = sql
>                 key = User-Name
>                 reset = never
>                 query = "SELECT SUM(AcctSessionTime - GREATEST((%b -
> UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND
> UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
> }
> 
> and i set 86400 in radgroupcheck, and input :
> 
> INSERT INTO radgroupcheck (id,GroupName,Attribute,Value,op)
>     -> VALUES
> ('','plan_name','Password-Expire','86400',':=');
> 
> is it will work regard to my case ? the point is, customer cant login
> after next day, the login voucher will valid for twenty four hours
> from the first time login. please advice. thanks
> 
> 
> -- 
> Best regards,
>  avudz
> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to