using SQL, where is Session-Timeout updated?
Hi all, Having these _prepaid_ internet access accounts: SELECT * FROM radcheck; +----+----------------+--------------------+------------------+------+ | id | UserName | Attribute | Value | Op | +----+----------------+--------------------+------------------+------+ | 1 | fredf | Cleartext-Password | wilma | := | | 2 | barney | Cleartext-Password | betty | := | +----+----------------+--------------------+------------------+------+ And this: SELECT * FROM radreply; +----+------------+-------------------+---------------------------------+------+ | id | UserName | Attribute | Value | Op | +----+------------+-------------------+---------------------------------+------+ [...] | 2 | barney | Session-Timeout | 500 | := | | 3 | fredf | Session-Timeout | 250 | := | [...] +----+------------+-------------------+---------------------------------+------+ In reality I use PGSQL. Reading the queries in dialup.conf, I dont see any update of radreply in order to decrease the Session-Timeout. As far as I know, Session-Timeout should be decreased the number of seconds the user has been "connected" Where, in the out of the box PGSQL suggested schema is accounting updating this Session-Timeout attribute? Thank you. Using packaged freeradius and postgresql-8.3 on Debian Lenny. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34
Reading the queries in dialup.conf, I dont see any update of radreply in order to decrease the Session-Timeout.
As far as I know, Session-Timeout should be decreased the number of seconds the user has been "connected"
Where, in the out of the box PGSQL suggested schema is accounting updating this Session-Timeout attribute?
You need sqlcounter (counter.conf) for that. You list counter check item in radcheck/radgroupcheck (and remove Session-Timeout from radreply). And add counter to instantiate (radiusd.conf) and authorize sections. Ivan Kalik Kalik Informatika ISP
09/18/2009 11:49 AM, Ivan Kalik:
You need sqlcounter (counter.conf) for that.
Found. but no UPDATE query in it.
You list counter check item in radcheck/radgroupcheck
Humm.... I dont really understand: Table "public.radcheck" Column | Type | Modifiers -----------+------------------------+------------------------------------------------------- id | integer | not null default nextval('radcheck_id_seq'::regclass) username | character varying(64) | not null default ''::character varying attribute | character varying(64) | not null default ''::character varying op | character(2) | not null default '=='::bpchar value | character varying(253) | not null default ''::character varying Do you mean like this? # SELECT * FROM radcheck; id | username | attribute | op | value ----+----------+--------------------+----+------- 1 | mihamina | Cleartext-Password | := | rktmb 5 | mihamina | Session-Timeout | := | 300 -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34
You need sqlcounter (counter.conf) for that.
Found. but no UPDATE query in it.
Oddly enough, counter doesn't update anything - it COUNTS. It counts how much time has been used in current period (on previous logins) and deducts that from the limit. You can choose the reset period (daily counter resets every day, weekly every week etc.) and the limit. You set the limit by placing attribute configured as check_name in radcheck table with the value of max allowed time in seconds. Example, for daily limit of 1 hour you would enter: username Max-Daily-Session := 3600 Ivan Kalik Kalik Informatika ISP
09/18/2009 12:51 PM, Ivan Kalik::
You need sqlcounter (counter.conf) for that. Found. but no UPDATE query in it. Oddly enough, counter doesn't update anything - it COUNTS.
OK, Attached is my 'default' file, and the 'freeradius -X' output. the counter (in counter.conf) is: sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), ..." } What is wrong? freeradius does not start because " "SQL Counter" modules aren't allowed in 'accounting' sections". It is told to put it in 'accounting'... -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34
sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), ..." }
What is wrong? freeradius does not start because " "SQL Counter" modules aren't allowed in 'accounting' sections".
It is told to put it in 'accounting'...
No, you weren't told to put it there. Read again my message about where are you supposed to list it. Ivan Kalik Kalik Informatika ISP
09/18/2009 05:41 PM, Ivan Kalik::
sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), ..." } What is wrong? freeradius does not start because " "SQL Counter" modules aren't allowed in 'accounting' sections". It is told to put it in 'accounting'... No, you weren't told to put it there. Read again my message about where are you supposed to list it.
from stock radiusd.conf, arround line #1488: # [...] # The module should be added in the instantiate, authorize and # accounting sections. [...] Ivan, I merged your explanation with what is in the documentation. Of course you did not tell me "accounting" but, I read it in radiusd.conf. Should I remove it from "accounting {...}" or move it elsewhere? When I think about it, placing it in "accounting" is a bit useless, because the counter call occurs when "radreply" (after authentication). It seems logical not to have to put it in here... But as well as I begin with RADIUS in general,... Your advices are welcome. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 29 155 34
09/18/2009 05:41 PM, Ivan Kalik::
sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), ..." } What is wrong? freeradius does not start because " "SQL Counter" modules aren't allowed in 'accounting' sections". It is told to put it in 'accounting'... No, you weren't told to put it there. Read again my message about where are you supposed to list it.
from stock radiusd.conf, arround line #1488: # [...] # The module should be added in the instantiate, authorize and # accounting sections. [...]
That's instruction for counter, not sqlcounter module. That's not the same thing. Ivan Kalik Kalik Informatika ISP
participants (2)
-
Ivan Kalik -
Rakotomandimby Mihamina