Hi, finally I've decided to use sql instead of flat files. there is in config "delete_stale_sessions = yes" from where radius know that is stale sessions? some other programs do I have to run? There is in documentation that to keep online sessions users in one table and history seesions in other table. How to achieve it from freeradius? -- Pozdrawiam Marcin / nicraM
On Apr 9, 2015, at 7:18 AM, Marcin <marcin@nicram.net> wrote:
there is in config "delete_stale_sessions = yes" from where radius know that is stale sessions? some other programs do I have to run?
See the comments for "delete_stale_sessions". It's run when you set Simultaneous-Use, and the "checkrad" program sees that a session is stale. FreeRADIUS is NOT a "cron" system. It doesn't run period jobs. It doesn't clean up SQL. It's a RADIUS server. Nothing more.
There is in documentation that to keep online sessions users in one table and history seesions in other table. How to achieve it from freeradius?
You need to understand SQL, and configure it yourself. The people who wrote that document did NOT contribute any patches back to FreeRADIUS. So... the default configuration doesn't have that capability. Alan DeKok.
2015-04-09 15:06 GMT+02:00 Alan DeKok <aland@deployingradius.com>:
On Apr 9, 2015, at 7:18 AM, Marcin <marcin@nicram.net> wrote:
there is in config "delete_stale_sessions = yes" from where radius know that is stale sessions? some other programs do I have to run?
See the comments for "delete_stale_sessions". It's run when you set Simultaneous-Use, and the "checkrad" program sees that a session is stale.
Ok, that i understand that i have to write a script which gets information from database about online connections and connects to nas? do you have any example of usage?
FreeRADIUS is NOT a "cron" system. It doesn't run period jobs. It doesn't clean up SQL. It's a RADIUS server. Nothing more.
There is in documentation that to keep online sessions users in one table and history seesions in other table. How to achieve it from freeradius?
You need to understand SQL, and configure it yourself. The people who wrote that document did NOT contribute any patches back to FreeRADIUS. So... the default configuration doesn't have that capability.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pozdrawiam Marcin / nicraM
On Apr 9, 2015, at 9:13 AM, Marcin <marcin@nicram.net> wrote:
Ok, that i understand that i have to write a script which gets information from database about online connections and connects to nas?
No. I said there's a "checkrad" program. It comes with the server.
do you have any example of usage?
Go to the Wiki, and read the docs on Simultaneous-Use. Alan DeKok.
some link from wiki? search button in FR wiki doesn't tell anything interesting. this wiki is totally mess, everything everywhere and nothig practical 2015-04-09 15:55 GMT+02:00 Alan DeKok <aland@deployingradius.com>:
On Apr 9, 2015, at 9:13 AM, Marcin <marcin@nicram.net> wrote:
Ok, that i understand that i have to write a script which gets information from database about online connections and connects to nas?
No. I said there's a "checkrad" program. It comes with the server.
do you have any example of usage?
Go to the Wiki, and read the docs on Simultaneous-Use.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pozdrawiam Marcin / nicraM
On 9 Apr 2015, at 10:57, Marcin <marcin@nicram.net> wrote:
some link from wiki? search button in FR wiki doesn't tell anything interesting. this wiki is totally mess, everything everywhere and nothig practical
So contribute to it. It's maintained by users, like yourself. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
2015-04-09 17:04 GMT+02:00 Arran Cudbard-Bell <a.cudbardb@freeradius.org>:
So contribute to it. It's maintained by users, like yourself.
I know, but there such mess that find something interesting it's like miracle. Some one shuld manage this. Have you ever tried to search about something you want to achieve but you didn't know how? I tried couple of times but without result, that why I write here. So understand me, please. Postgresql's wiki is maintained by users too, but there is enough practical information with proper chapters. -- Pozdrawiam Marcin / nicraM
On Thu, Apr 9, 2015 at 9:57 AM, Marcin <marcin@nicram.net> wrote:
some link from wiki?
2015-04-09 17:07 GMT+02:00 Matt Zagrabelny <mzagrabe@d.umn.edu>:
On Thu, Apr 9, 2015 at 9:57 AM, Marcin <marcin@nicram.net> wrote:
some link from wiki?
could You point me, which link in wiki is solution of my problem? I know what is simultaneous-use but i asked about remove staled sessions and Alan mentioned about checkrad. This link is like other - without answers. -- Pozdrawiam Marcin / nicraM
On 04/09/2015 03:18 PM, Marcin wrote:
2015-04-09 17:07 GMT+02:00 Matt Zagrabelny <mzagrabe@d.umn.edu>:
On Thu, Apr 9, 2015 at 9:57 AM, Marcin <marcin@nicram.net> wrote:
some link from wiki? http://wiki.freeradius.org/search?q=Simultaneous-Use
could You point me, which link in wiki is solution of my problem? I know what is simultaneous-use but i asked about remove staled sessions and Alan mentioned about checkrad. This link is like other - without answers.
maybe this line should do for you /usr/bin/mysql -u radiususername -pradiuspassword radiusdatabase -e "delete from radacct where acctstoptime is not NULL ;
2015-04-09 17:38 GMT+02:00 Anil Thapa <anilth@hi.is>:
maybe this line should do for you
/usr/bin/mysql -u radiususername -pradiuspassword radiusdatabase -e "delete from radacct where acctstoptime is not NULL ;
this clear all sessions :) now, in other location i use perl script in cron #v+ #!/usr/bin/perl #use warnings; use strict; use locale; use DBI; $ENV{'PATH'}='/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin'; my $dbtype = 'mysql'; my $dbhost = 'localhost'; my $dbuser = 'radius'; my $dbpasswd = 'pass'; my $dbname = 'radius'; my $dbase = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost","$dbuser","$dbpasswd", { RaiseError => 1 }); $dbase->do("SET NAMES utf8"); my $utsfmt = "UNIX_TIMESTAMP()"; my $dbq = $dbase->prepare("UPDATE radacct SET acctterminatecause = 'Script - reset', acctstoptime = now() WHERE (acctstarttime + INTERVAL acctsessiontime SECOND) < (now() - INTERVAL 1200 SECOND) AND acctstoptime = '0000-00-00 00:00:00' "); $dbq->execute() or die $dbq->errstr; $dbq->finish(); $dbase->disconnect(); # #v- but i've thougt that is other solution, because i wanted to resign from database to flat files. --
Pozdrawiam Marcin / nicraM
On Thu, Apr 09, 2015 at 05:53:23PM +0200, Marcin wrote:
2015-04-09 17:38 GMT+02:00 Anil Thapa <anilth@hi.is>:
maybe this line should do for you
/usr/bin/mysql -u radiususername -pradiuspassword radiusdatabase -e "delete from radacct where acctstoptime is not NULL ;
but i've thougt that is other solution, because i wanted to resign from database to flat files.
As suggested a couple of weeks ago, there are other methods - you could investigate redis for example. That would synchronize your session data around without the pain of SQL, and also allows you to set expiry timers on records so they automatically vanish after a certain time. I'm not sure if there is documentation on how to do it, but it should be possible and be a much cleaner solution. Matthew -- Matthew Newton, Ph.D. <mcn4@le.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom For IT help contact helpdesk extn. 2253, <ithelp@le.ac.uk>
2015-04-09 18:22 GMT+02:00 Matthew Newton <mcn4@leicester.ac.uk>:
could investigate redis for example. That would synchronize your session data around without the pain of SQL, and also allows you to set expiry timers on records so they automatically vanish after a certain time.
Yes, i remember, but these are additional daemons still. In that case I prefer to use database and some replication or drbd with HA. -- Pozdrawiam Marcin / nicraM
That, what is proper way? I'm not profesionalist so please understand me. 9 kwi 2015 18:38 <A.L.M.Buxey@lboro.ac.uk> napisał(a):
Hi,
but i've thougt that is other solution, because i wanted to resign from database to flat files.
you've been on about this before. sorry your architecture is wrong. and there are no prebuilt solutions in the WIKI because you are going the wrong way
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 9 Apr 2015, at 13:13, Marcin <marcin@nicram.net> wrote:
That, what is proper way? I'm not profesionalist so please understand me.
Set the interim update period to something like 15 minutes. https://github.com/FreeRADIUS/freeradius-server/blob/v3.1.x/raddb/mods-confi... Write a cron job to close out sessions, either using radclient to fake stop messages, or just by setting acctstoptime to NOW()) where (NOW() - <interim period>) > acctupdatetime. Run it every 5 minutes. Don't use the delete_stale_sessions option, it likely doesn't do what you want. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
2015-04-09 20:12 GMT+02:00 Arran Cudbard-Bell <a.cudbardb@freeradius.org>:
On 9 Apr 2015, at 13:13, Marcin <marcin@nicram.net> wrote:
That, what is proper way? I'm not profesionalist so please understand me.
Set the interim update period to something like 15 minutes.
https://github.com/FreeRADIUS/freeradius-server/blob/v3.1.x/raddb/mods-confi...
Write a cron job to close out sessions, either using radclient to fake stop messages, or just by setting acctstoptime to NOW()) where (NOW() - <interim period>) > acctupdatetime.
that is what i do now on other remote location.
Run it every 5 minutes.
Don't use the delete_stale_sessions option, it likely doesn't do what you want.
Ok, if proffesionalists say that using database is the most proper way to deal with it, that i won't be discuss. Thanks for help -- Pozdrawiam Marcin / nicraM
participants (7)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Anil Thapa -
Arran Cudbard-Bell -
Marcin -
Matt Zagrabelny -
Matthew Newton