(RADIATOR) Problems with Session Database.

Shon Stephens sstephens at corp.goamerica.net
Tue May 15 13:02:29 CDT 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alright, I know this is a much covered topic, but I'm still having
some difficulty. 
I believe this is how Radiator should be working. I am using
<SessionDatabase SQL> and <AuthBy SQL>. Please tell me if this is
incorrect.

The NAS sends an Auth-Request to Radiator. Radiator will execute the
DeleteQuery "delete from RADONLINE where USERNAME='%n' and
NASIDENITIFIER='%N' and NASPORT='%{Nas-Port}' This is to correct for
dupes. Once this is done, it executes the CountQuery "select
NASIDENTIFIER,NASPORT,ACCTSESSIONID from RADONLINE where USERNAME =
'%n'; If the number of unique sessions doesn't exceed the set limit,
then the AuthSelect query is executed. If the user authenticates
correctly, Radiator will send an Auth-Accept back to the NAS. Which
then (in most cases) will send an Acct-Start request. When this
request is recieved, Radiator will then insert the Acct-Start data
into the Accounting Database. It will also insert the session data
into the SessionDB using the AddQuery "insert into RADONLINE
(USERNAME,NASIDENTIFIER,NASPORT,ACCTSESSIONID,
TIME_STAMP,FRAMEDIPADDRESS,PORTYTPE,SERVICETYPE) values ('%n', '%N',
'%{Nas-Port}', '%{Acct-Session-Id}', '%{Timestamp}', 
'%{Framed-IP-Address}', '%{Port-Type}', '%{Service-Type}')

I may have the order of the insert into Accounting and Session
reversed. I am not sure. Either way, my session database never
updates. Here is my configuration:

<SessionDatabase SQL>
    Identifier DefaultSDB
    DBSource dbi:mysql:radius:mysqlhost
    DBUsername mysqluser
    DBAuth password
    AddQuery insert into sessions (username, time_stamp, session_id,
\
    nas_identifier, nas_port, framed_ip_addr) values ('%U', \
    '%{GlobalVar:TimestampFormatted}', '%{Acct-Session-Id}', \
    '%{NAS-Identifier}', '%{NAS-Port}', '%{Framed-IP-Address}')
    DeleteQuery delete from sessions where username='%U' and \
    nas_identifier='%{NAS-Identifier}' and nas_port='%{NAS-Port}'
    ClearNasQuery delete from sessions where nas_identifier= \
    '%{NAS-Identifier}'
    CountQuery select nas_identifier,nas_port,session_id from
sessions \
    where username='%U'
</SessionDatabase>

<Realm static.goamerica.net>
    SessionDatabase DefaultSDB
    MaxSessions 1 
  <AuthBy SQL>
      DBSource dbi:mysql:radius:mysqlhost
      DBUsername mysqluser
      DBAuth password
      Timeout 120
      FailureBackoffTime  150
      AuthSelect select password, check, reply from users where \
      username='%U'
      AuthColumnDef 0, User-Password, check
      AuthColumnDef 1, GENERIC, check
      AuthColumnDef 2, GENERIC, reply
      AccountingTable accounting
      DateFormat %x-%d%M%Y
      AcctColumnDef username, User-Name, string
      AcctColumnDef time_stamp, Timestamp, integer-date
      AcctColumnDef status_type, Acct-Status-Type, integer
      AcctColumnDef input_octets, Acct-Input-Octets, integer
      AcctColumnDef output_octets, Acct-Output-Octets, integer
      AcctColumnDef session_id, Acct-Session-Id, string
      AcctColumnDef session_time, Acct-Session-Time, integer
      AcctColumnDef terminate_cause, Acct-Terminate-Cause, integer
      AcctColumnDef nas_identifier, NAS-Identifier, string
      AcctColumnDef nas_port, NAS-Port, integer
      AcctColumnDef framed_ip_addr, Framed-IP-Address, string
  </AuthBy>
</Realm>

I am using radpwtst to test this. To make sure that the entry is not
deleted from the session database, I do not send an Acct-Stop. I also
change my Nas-Port. However, even on the first attempt, without a
Acct-Stop Request, Radiator never attempts to execute the AddQuery. I
have looked at my Radiator log files. There are no errors reported. I
have looked at the packet dumps. Everything appears good. When
looking at the query logs on my SQL server, there is never an attempt
to perform an insert into sessions. It just doesn't happen, no
errors, no hiccups, just no session tracking. Why isn't this
happening. I have looked at this a dozen times. Yes, my table names
and formats are different from the default, but I compensate for this
by changing the query statements in the radius.cfg file. Thanks for
looking at this novel.

Shon Stephens
sstephens at corp.goamerica.net

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBOwFvMUwGLkuD4lDdEQLT6ACfZjzMoDGLmpUqcKVrfOclwhip0kYAn1nt
QbCPt0G7L2F7BXO5FbX59pnL
=L4JK
-----END PGP SIGNATURE-----

===
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