(RADIATOR) Session database with mysql

Hugh Irvine hugh at open.com.au
Wed Jan 15 20:08:07 CST 2003


Hello -

The usual reason for stale records being left in the session database 
is missing stop records. In other words, if you do not receive a stop 
record when a user session completes, then you will not delete that 
users record from the session database.

It is also possible that the delete query that you show below is not 
correct. Have you checked a trace 4 to make sure that this is doing the 
right thing and deleting the correct record?

I will need to see the complete configuration file (no secrets) 
together with a trace 4 debug from Radiator showing what is happening.

regards

Hugh


On Wednesday, Jan 15, 2003, at 21:22 Australia/Melbourne, 
<tdn at tdn.co.ke> wrote:

> Hello,
>
> Am trying to implement a session database using a mysql database.
> My problem is that i notice that there are so many cases when people 
> have
> actually logged out, but not
> deleted from the database.
>
> (see my database structure and part of my cfg file)
>
> create table radonline (
>         username       char(50) NOT NULL,
>         nasidentifier   char(50),
>          nasipaddress char(15),
>         nasport         int,
>         acctsessionid   char(30) NOT NULL,
>         time_stamp               int,
>         framedipaddress          char(15),
>         nasporttype              char(10),
>         servicetype              char(20),
>         calledstationid          char(16),
>         callingstationid         char(16),
>          usrchassiscallslot       int,
>          usrchassiscallchannel    int,
>
>         UNIQUE RADONLINE_I (nasidentifier, username),
>         INDEX RADONLINE_I2 (username)
> );
>
>
>
> cfg file
> =========
>
>
> SessionDatabase SQL>
>         Identifier InSQL
>
>         DBSource        dbi:mysql:radonline:1.1.1.1
>         DBUsername     xxxx
>         DBAuth         xxx
>
>
>         AddQuery insert into radonline (username, \
>                                         nasidentifier, \
>                                         nasipaddress, \
>                                         nasport, \
>                                         acctsessionid, \
>                                         time_stamp, \
>                                         framedipaddress, \
>                                         nasporttype, \
>                                         servicetype, \
>                                         calledstationid, \
>                                         callingstationid, \
>                                         usrchassiscallslot, \
>                                         usrchassiscallchannel) \
>                         values ('%u', \
>                                 '%N', \
>                                 '%{NAS-IP-Address}', \
>                                 0%{NAS-Port}, \
>                                 '%{Acct-Session-Id}',  \
>                                 %{Timestamp}, \
>                                 '%{Framed-IP-Address}', \
>                                 '%{NAS-Port-Type}', \
>                                 '%{Service-Type}', \
>                                 '%{Called-Station-Id}', \
>                                 '%{Calling-Station-Id}', \
>                                 0%{USR-Chassis-Call-Slot}, \
>                                 0%{USR-Chassis-Call-Channel} )
>
>        DeleteQuery delete from radonline where acctsessionid='%4' and
> nasipaddress='%2' and username='%u'
>
>        ClearNasQuery    delete from radonline where nasidentifier='%N'
>
>        CountQuery    select
> nasidentifier,nasport,acctsessionid,framedipaddress from radonline 
> where
> username='%u'
> </SessionDatabase>
>
> TDN
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list