Wait period between sessions
I have asked this question before without result so thought I'd re-ask with additional clarification. I have a user group that is only allowed 3hr session times (easily resolved with sql counter module) with a 15 minute wait period between sessions. Has anyone written a module or know of a way to implement this wait period. I was thinking something similar to a module based around the sql max session module only query the sql backend for the last time connected and if the period is less than set variable (15 mins in my case) then reject access with an error message like "Wait Period Enforced" Regards Cory Robson
Cory Robson wrote:
I have a user group that is only allowed 3hr session times (easily resolved with sql counter module) with a 15 minute wait period between sessions.
Has anyone written a module or know of a way to implement this wait period.
A shell script would work.
I was thinking something similar to a module based around the sql max session module only query the sql backend for the last time connected and if the period is less than set variable (15 mins in my case) then reject access with an error message like "Wait Period Enforced"
Or, update the SQL query for Acct-Status-Type == Stop. Have it insert another field, saying when the user can next login. On login, check that field. I think you can do this without writing a module. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
On Fri 23 Feb 2007 10:53, Alan DeKok wrote:
Cory Robson wrote:
I have a user group that is only allowed 3hr session times (easily resolved with sql counter module) with a 15 minute wait period between sessions.
Has anyone written a module or know of a way to implement this wait period.
A shell script would work.
I was thinking something similar to a module based around the sql max session module only query the sql backend for the last time connected and if the period is less than set variable (15 mins in my case) then reject access with an error message like "Wait Period Enforced"
Or, update the SQL query for Acct-Status-Type == Stop. Have it insert another field, saying when the user can next login. On login, check that field.
I think you can do this without writing a module.
Definitely yes. The question is what happens if the user manually disconnects prior to his session timeout then tries to reconnect.... -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
-----Original Message----- From: freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org [mailto:freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org] On Behalf Of Peter Nixon Sent: Saturday, 24 February 2007 2:54 AM To: FreeRadius users mailing list Subject: Re: Wait period between sessions On Fri 23 Feb 2007 10:53, Alan DeKok wrote:
Cory Robson wrote:
I have a user group that is only allowed 3hr session times (easily resolved with sql counter module) with a 15 minute wait period between sessions.
Has anyone written a module or know of a way to implement this wait period.
A shell script would work.
I was thinking something similar to a module based around the sql max session module only query the sql backend for the last time connected and if the period is less than set variable (15 mins in my case) then reject access with an error message like "Wait Period Enforced"
Or, update the SQL query for Acct-Status-Type == Stop. Have it insert another field, saying when the user can next login. On login, check that field.
I think you can do this without writing a module.
Definitely yes. The question is what happens if the user manually disconnects prior to his session timeout then tries to reconnect.... In my needs he will still be subject to a wait period. Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html __________ NOD32 2078 (20070223) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com
On 2/23/2007, "Cory Robson" <cory@cmi.net.au> wrote:
I have a user group that is only allowed 3hr session times (easily resolved with sql counter module) with a 15 minute wait period between sessions.
Simple questions... how and where to get sql counter module ? I try to googling for hours but still can not find it. TIA PD
On 2/24/07, PD <paul@ranahminang.net> wrote:
Simple questions... how and where to get sql counter module ? I try to googling for hours but still can not find it.
TIA
PD
You should compile FR with experimental modules You have to create the module yourself Read rlm_sqlcounter in the doc/ folder . It's explained how to use this. Kind Regards, Yves
YvesDM wrote:
On 2/24/07, *PD* <paul@ranahminang.net <mailto:paul@ranahminang.net>> wrote:
Simple questions... how and where to get sql counter module ? I try to googling for hours but still can not find it.
TIA
PD
You should compile FR with experimental modules You have to create the module yourself Read rlm_sqlcounter in the doc/ folder . It's explained how to use this.
In the current version of FR (1.1.4) the sqlcounter module is no longer experimental - comes as in the default collection of modules. There is also a wiki article on using sqlcounter: http://wiki.freeradius.org/Rlm_sqlcounter Its not complete but I am working on it. -- Graham Beneke
On 2/24/07, Graham Beneke <graham_bulk@apolix.co.za> wrote:
In the current version of FR (1.1.4) the sqlcounter module is no longer experimental - comes as in the default collection of modules.
There is also a wiki article on using sqlcounter: http://wiki.freeradius.org/Rlm_sqlcounter
Its not complete but I am working on it.
-- Graham Beneke
Interesting, tnx for your work! I'm struggling with the sqlcounter module too for the moment. Try to define the reply-name (FR1.1.4), but it gives me errors If I specify this in sqlcounter.conf: sqlcounter volumelimit { counter-name = Octets-Total check-name = Max-Octets reply-name = ChilliSpot-Max-Total-Octets sqlmod-inst = sql key = User-Name reset = monthly # This query will calculate the total volume used it results in: freeradius -X | grep sqlcounter <snip> sqlcounter: counter-name = "Octets-Total" sqlcounter: check-name = "Max-Octets" sqlcounter: reply-name = "ChilliSpot-Max-Total-Octets" sqlcounter: key = "User-Name" sqlcounter: sqlmod-inst = "sql" sqlcounter: query = "SELECT (SUM(AcctInputOctets) +SUM(AcctInputGigawords * 4294967295) +SUM(AcctOutputOctets) +SUM(AcctOutputGigawords * 4294967295)) / 1048576 FROM radacct WHERE UserName = '%{%k}' AND AcctStartTime > FROM_UNIXTIME('%b')" sqlcounter: reset = "monthly" sqlcounter: safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" rlm_sqlcounter: No such attribute ChilliSpot-Max-Total-Octets obelix:/etc/freeradius# sqlcounter: counter-name = "Octets-Total" sqlcounter: check-name = "Max-Octets" sqlcounter: reply-name = "ChilliSpot-Max-Total-Octets" sqlcounter: key = "User-Name" sqlcounter: sqlmod-inst = "sql" sqlcounter: query = "SELECT (SUM(AcctInputOctets) +SUM(AcctInputGigawords * 4294967295) +SUM(AcctOutputOctets) +SUM(AcctOutputGigawords * 4294967295)) / 1048576 FROM radacct WHERE UserName = '%{%k}' AND AcctStartTime > FROM_UNIXTIME('%b')" sqlcounter: reset = "monthly" sqlcounter: safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" rlm_sqlcounter: No such attribute ChilliSpot-Max-Total-Octets obelix:/etc/freeradius# Strange... But I'm not in a rush, I'll find out what's wrong :-) Kind regards, Yves
YvesDM wrote:
rlm_sqlcounter: No such attribute ChilliSpot-Max-Total-Octets obelix:/etc/freeradius#
Strange... But I'm not in a rush, I'll find out what's wrong :-)
Looks like a dictionary problem to me - Chillispot's dictionary is not yet part of FR you have to add it manually. Maybe someone with a little spare time can throw together the Chillispot dictionary as a patch ;-) Graham Beneke
On 2/24/07, Graham Beneke <graham_bulk@apolix.co.za> wrote:
YvesDM wrote:
rlm_sqlcounter: No such attribute ChilliSpot-Max-Total-Octets obelix:/etc/freeradius#
Strange... But I'm not in a rush, I'll find out what's wrong :-)
Looks like a dictionary problem to me - Chillispot's dictionary is not yet part of FR you have to add it manually.
Maybe someone with a little spare time can throw together the Chillispot dictionary as a patch ;-)
Graham Beneke
Yeah, that w
On 2/24/07, Graham Beneke <graham_bulk@apolix.co.za> wrote:
Looks like a dictionary problem to me - Chillispot's dictionary is not yet part of FR you have to add it manually.
Maybe someone with a little spare time can throw together the Chillispot dictionary as a patch ;-)
Graham Beneke
Yeah, that was my first thought too, but I've added the dictionary before, so the dictionary is there.... Kind regards, Yves
Just "vim /etc/freeradius/dictionary" and include the following line "$INCLUDE /usr/share/freeradius/dictionary.chillispot" Oh, and move the chillispot.dictionary file into the /usr/share/freeradius directory just to keep things neat! Goodluck! Tas. YvesDM wrote:
On 2/24/07, *Graham Beneke* <graham_bulk@apolix.co.za <mailto:graham_bulk@apolix.co.za>> wrote:
Looks like a dictionary problem to me - Chillispot's dictionary is not yet part of FR you have to add it manually.
Maybe someone with a little spare time can throw together the Chillispot dictionary as a patch ;-)
Graham Beneke
Yeah, that was my first thought too, but I've added the dictionary before, so the dictionary is there....
Kind regards, Yves
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 2/25/07, Tas Dionisakos <tas@newman.unimelb.edu.au> wrote:
Just "vim /etc/freeradius/dictionary"
and include the following line
"$INCLUDE /usr/share/freeradius/dictionary.chillispot"
Oh, and move the chillispot.dictionary file into the /usr/share/freeradius directory just to keep things neat!
Goodluck!
Tas.
Arrgh....how could i forget that $include ! Anyway, I just added the line in /usr/share/dictionary itself, $INCLUDE dictionary.chillispot Many thanks Kind Regards, Yves
----- Original Message ----- From: YvesDM To: FreeRadius users mailing list Sent: Saturday, February 24, 2007 9:03 AM Subject: Re: Where to find sql counter module ? On 2/24/07, PD <paul@ranahminang.net> wrote: Simple questions... how and where to get sql counter module ? I try to googling for hours but still can not find it. TIA PD You should compile FR with experimental modules You have to create the module yourself Read rlm_sqlcounter in the doc/ folder . It's explained how to use this. Kind Regards, Yves ------------------------------------------------------------------------------ Everithing step I do, but, if the Max-Daily-Session > 3600, the FR not do anything. why?
participants (8)
-
Abel Monzón -
Alan DeKok -
Cory Robson -
Graham Beneke -
PD -
Peter Nixon -
Tas Dionisakos -
YvesDM